TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::det_manip::det_manip_basic< FunctionType >

#include <triqs/det_manip/det_manip_basic.hpp>

Detailed Description

template<typename FunctionType>
class triqs::det_manip::det_manip_basic< FunctionType >

Simple reference implementation of determinant manipulation for CTQMC solvers.

This class manipulates the determinant \( \det(F^{(n)}) \) of a matrix whose elements are given by a callable \( F^{(n)}_{ij} = f(x_i, y_j) \) (see Determinant manipulation for the general setup).

It exposes the same API as triqs::det_manip::det_manip (the same try/complete operations, accessors and HDF5 support), but uses a straightforward implementation: instead of the fast rank-update algorithm, it rebuilds the matrix and recomputes the determinant (and, on demand, the inverse) from scratch on every operation. It does not track row/column permutations or a sign, so the matrix is stored in the user's order, i.e. the internal order equals the user order.

This makes it simpler and easier to verify, but asymptotically slower than triqs::det_manip::det_manip; it is primarily useful as a reference/testing implementation.

Template Parameters
FunctionTypeCallable object \( f \) that takes two arguments and returns a real or complex value. It determines the elements of the matrix via \( F^{(n)}_{ij} = f(x_i, y_j) \).

Definition at line 65 of file det_manip_basic.hpp.

Public Types

enum  RollDirection
 Direction of the roll_matrix() operation. More...

Public Member Functions

template<typename ArgumentContainer1, typename ArgumentContainer2>
 det_manip_basic (FunctionType F, ArgumentContainer1 const &X, ArgumentContainer2 const &Y)
 Construct a det_manip_basic object with a callable FunctionType and two containers holding the arguments for the matrix builder.
 det_manip_basic (FunctionType F, long init_size)
 Construct a det_manip_basic object with a callable FunctionType and an initial capacity for the data storages.
matrix_type build_matrix_scratch ()
 Build the matrix \( F^{(n)} \) from scratch from the stored arguments.
value_type change_col (long j, y_type const &y)
 Change one column.
value_type change_one_row_and_one_col (long i, long j, x_type const &x, y_type const &y)
 Change one row and one column.
value_type change_row (long i, x_type const &x)
 Change one row.
void clear ()
 Clear the data storages and reset the matrix to size zero.
void complete_operation ()
 Complete the last try-operation.
auto determinant ()
 Get the determinant of the matrix \( F^{(n)} \).
FunctionType const & get_function () const
 Get the callable FunctionType object \( f \) used as the matrix builder.
auto get_x () const
 Get a vector with all matrix builder arguments \( \mathbf{x} \).
x_type const & get_x (long i) const
 Get the matrix builder argument \( x_i \) that determines the elements of the ith row.
auto const & get_x_internal_order () const
 Get the matrix builder arguments \( \mathbf{x} \) in internal storage order.
auto get_y () const
 Get a vector with all matrix builder arguments \( \mathbf{y} \).
y_type const & get_y (long j) const
 Get the matrix builder argument \( y_j \) that determines the elements of the jth column.
auto const & get_y_internal_order () const
 Get the matrix builder arguments \( \mathbf{y} \) in internal storage order.
value_type insert (long i, long j, x_type const &x, y_type const &y)
 Insert one row and column.
value_type insert2 (long i0, long i1, long j0, long j1, x_type const &x0, x_type const &x1, y_type const &y0, y_type const &y1)
 Insert two rows and columns.
value_type insert2_at_end (x_type const &x0, x_type const &x1, y_type const &y0, y_type const &y1)
 Insert two rows and columns at the end of the matrix.
value_type insert_at_end (x_type const &x, y_type const &y)
 Insert one row and column at the end of the matrix.
template<nda::Array X, nda::Array Y>
requires (nda::get_rank<X> == nda::get_rank<Y>)
auto insert_ratios (long i, long j, X const &xs, Y const &ys) const -> nda::array< value_type, nda::get_rank< X > >
 Compute independent single-insertion determinant ratios at position \( (i, j) \) for paired elements of xs and ys.
nda::matrix_const_view< value_type > inverse_matrix () const
 Get the full inverse matrix \( [F^{(n)}]^{-1} \).
value_type inverse_matrix (int i, int j) const
 Get an element of the inverse matrix \( [F^{(n)}]^{-1} \).
nda::matrix_const_view< value_type > inverse_matrix_internal_order () const
 Get the full inverse matrix in internal storage order.
value_type inverse_matrix_internal_order (int i, int j) const
 Get an element of the inverse matrix in internal storage order.
matrix_type matrix () const
 Get the matrix \( F^{(n)} \).
value_type matrix (int i, int j) const
 Get an element of the matrix \( F^{(n)} \).
void reject_last_try ()
 Reject the last try-operation.
value_type remove (long i, long j)
 Remove one row and column.
value_type remove2 (long i0, long i1, long j0, long j1)
 Remove two rows and columns.
value_type remove2_at_end ()
 Remove the last two rows and columns of the matrix.
value_type remove_at_end ()
 Remove the last row and column of the matrix.
void reserve (long new_size, long new_k=1)
 Reserve memory to increase the capacity of the data storages.
int roll_matrix (RollDirection roll)
 Perform a circular shift permutation on the rows or columns of the matrix \( F^{(n)} \).
auto size () const
 Get the current size of the matrix.
value_type try_change_col (long j, y_type const &y)
 Try to change one column in the matrix \( F^{(n)} \).
value_type try_change_col_row (long i, long j, x_type const &x, y_type const &y)
 Try to change one column and one row in the matrix \( F^{(n)} \).
value_type try_change_row (long i, x_type const &x)
 Try to change one row in the matrix \( F^{(n)} \).
value_type try_insert (long i, long j, x_type const &x, y_type const &y)
 Try to insert one row and column.
value_type try_insert2 (long i0, long i1, long j0, long j1, x_type const &x0_, x_type const &x1_, y_type const &y0_, y_type const &y1_)
 Try to insert two rows and columns.
value_type try_insert_k (std::vector< long > i, std::vector< long > j, std::vector< x_type > x, std::vector< y_type > y)
 Try to insert \( k \) rows and columns.
template<typename ArgumentContainer1, typename ArgumentContainer2>
value_type try_refill (ArgumentContainer1 const &X, ArgumentContainer2 const &Y)
 Try to fill the matrix \( F^{(n)} \) with new elements.
value_type try_remove (long i, long j)
 Try to remove one row and column.
value_type try_remove2 (long i0, long i1, long j0, long j1)
 Try to remove two rows and two columns.
value_type try_remove_k (std::vector< long > i, std::vector< long > j)
 Try to remove \( k \) rows and columns.

Friends

template<typename LambdaType>
void foreach (det_manip_basic const &d, LambdaType const &func)
 For-each implementation for triqs::det_manip::det_manip_basic objects.
void h5_read (h5::group fg, std::string subgroup_name, det_manip_basic &g)
 Read a triqs::det_manip::det_manip_basic object from HDF5.
void h5_write (h5::group fg, std::string subgroup_name, det_manip_basic const &g)
 Write a triqs::det_manip::det_manip_basic object to HDF5.

Member Enumeration Documentation

◆ RollDirection

template<typename FunctionType>
enum triqs::det_manip::det_manip_basic::RollDirection

Direction of the roll_matrix() operation.

It specifies the direction of the circular shift performed on either the rows or columns of the matrix \( F^{(n)} \). The following directions are supported:

  • None: No roll operation is performed.
  • Up: Roll the rows up (move the first row to the last, cyclically).
  • Down: Roll the rows down (move the last row to the first, cyclically).
  • Left: Roll the columns to the left (move the first column to the last, cyclically).
  • Right: Roll the columns to the right (move the last column to the first, cyclically).

Definition at line 1503 of file det_manip_basic.hpp.

Constructor & Destructor Documentation

◆ det_manip_basic() [1/2]

template<typename FunctionType>
triqs::det_manip::det_manip_basic< FunctionType >::det_manip_basic ( FunctionType F,
long init_size )
inline

Construct a det_manip_basic object with a callable FunctionType and an initial capacity for the data storages.

Like for std::vector, the capacity grows automatically (by a factor of 2) when needed, but this can yield a performance penalty if it happens too often.

Parameters
FCallable FunctionType object (a copy is stored in the class).
init_sizeInitial capacity for the size of the matrix, i.e. the maximum number of rows and columns.

Definition at line 245 of file det_manip_basic.hpp.

◆ det_manip_basic() [2/2]

template<typename FunctionType>
template<typename ArgumentContainer1, typename ArgumentContainer2>
triqs::det_manip::det_manip_basic< FunctionType >::det_manip_basic ( FunctionType F,
ArgumentContainer1 const & X,
ArgumentContainer2 const & Y )
inline

Construct a det_manip_basic object with a callable FunctionType and two containers holding the arguments for the matrix builder.

Template Parameters
ArgumentContainer1Container type holding the first arguments.
ArgumentContainer2Container type holding the second arguments.
Parameters
FCallable FunctionType object (a copy is stored in the class).
XContainer holding the first arguments \( \mathbf{x} \).
YContainer holding the second arguments \( \mathbf{y} \).

Definition at line 261 of file det_manip_basic.hpp.

Member Function Documentation

◆ build_matrix_scratch()

template<typename FunctionType>
matrix_type triqs::det_manip::det_manip_basic< FunctionType >::build_matrix_scratch ( )
inline

Build the matrix \( F^{(n)} \) from scratch from the stored arguments.

Evaluates \( f(x_i, y_j) \) for all \( i, j \) and returns a freshly allocated matrix.

Returns
The matrix \( F^{(n)} \).

Definition at line 299 of file det_manip_basic.hpp.

◆ change_col()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::change_col ( long j,
y_type const & y )
inline

Change one column.

Wrapper for try_change_col() followed by a complete_operation() call. See try_change_col() for details.

Parameters
jPosition of the column to be changed in the matrix \( F^{(n)} \).
yArgument to the matrix builder that determines the new elements of the column.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1456 of file det_manip_basic.hpp.

◆ change_one_row_and_one_col()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::change_one_row_and_one_col ( long i,
long j,
x_type const & x,
y_type const & y )
inline

Change one row and one column.

Wrapper for try_change_col_row() followed by a complete_operation() call. See try_change_col_row() for details.

Parameters
iPosition of the row to be changed in the matrix \( F^{(n)} \).
jPosition of the column to be changed in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the new elements of the row.
yArgument to the matrix builder that determines the new elements of the column.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1485 of file det_manip_basic.hpp.

◆ change_row()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::change_row ( long i,
x_type const & x )
inline

Change one row.

Wrapper for try_change_row() followed by a complete_operation() call. See try_change_row() for details.

Parameters
iPosition of the row to be changed in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the new elements of the row.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1469 of file det_manip_basic.hpp.

◆ complete_operation()

template<typename FunctionType>
void triqs::det_manip::det_manip_basic< FunctionType >::complete_operation ( )
inline

Complete the last try-operation.

It completes the last try-operation by applying the candidate matrix and determinant that were prepared by the corresponding try_* call, depending on the tag set in the last try function call.

Definition at line 1327 of file det_manip_basic.hpp.

◆ determinant()

template<typename FunctionType>
auto triqs::det_manip::det_manip_basic< FunctionType >::determinant ( )
inline

Get the determinant of the matrix \( F^{(n)} \).

Returns
Determinant \( \det(F^{(n)}) \).

Definition at line 402 of file det_manip_basic.hpp.

◆ get_function()

template<typename FunctionType>
FunctionType const & triqs::det_manip::det_manip_basic< FunctionType >::get_function ( ) const
inline

Get the callable FunctionType object \( f \) used as the matrix builder.

Returns
Const reference to the stored callable.

Definition at line 396 of file det_manip_basic.hpp.

◆ get_x() [1/2]

template<typename FunctionType>
auto triqs::det_manip::det_manip_basic< FunctionType >::get_x ( ) const
inline

Get a vector with all matrix builder arguments \( \mathbf{x} \).

Returns
std::vector containing the arguments \( x_i \).

Definition at line 354 of file det_manip_basic.hpp.

◆ get_x() [2/2]

template<typename FunctionType>
x_type const & triqs::det_manip::det_manip_basic< FunctionType >::get_x ( long i) const
inline

Get the matrix builder argument \( x_i \) that determines the elements of the ith row.

Parameters
iArgument index.
Returns
Argument value \( x_i \).

Definition at line 367 of file det_manip_basic.hpp.

◆ get_x_internal_order()

template<typename FunctionType>
auto const & triqs::det_manip::det_manip_basic< FunctionType >::get_x_internal_order ( ) const
inline

Get the matrix builder arguments \( \mathbf{x} \) in internal storage order.

For this class the internal order equals the user order (there is no permutation), so this returns the same as get_x().

Returns
std::vector containing the arguments \( x_i \).

Definition at line 382 of file det_manip_basic.hpp.

◆ get_y() [1/2]

template<typename FunctionType>
auto triqs::det_manip::det_manip_basic< FunctionType >::get_y ( ) const
inline

Get a vector with all matrix builder arguments \( \mathbf{y} \).

Returns
std::vector containing the arguments \( y_j \).

Definition at line 360 of file det_manip_basic.hpp.

◆ get_y() [2/2]

template<typename FunctionType>
y_type const & triqs::det_manip::det_manip_basic< FunctionType >::get_y ( long j) const
inline

Get the matrix builder argument \( y_j \) that determines the elements of the jth column.

Parameters
jArgument index.
Returns
Argument value \( y_j \).

Definition at line 374 of file det_manip_basic.hpp.

◆ get_y_internal_order()

template<typename FunctionType>
auto const & triqs::det_manip::det_manip_basic< FunctionType >::get_y_internal_order ( ) const
inline

Get the matrix builder arguments \( \mathbf{y} \) in internal storage order.

For this class the internal order equals the user order (there is no permutation), so this returns the same as get_y().

Returns
std::vector containing the arguments \( y_j \).

Definition at line 390 of file det_manip_basic.hpp.

◆ insert()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::insert ( long i,
long j,
x_type const & x,
y_type const & y )
inline

Insert one row and column.

Wrapper for try_insert() followed by a complete_operation() call. See try_insert() for details.

Parameters
iPosition of the row to be inserted in the matrix \( F^{(n)} \).
jPosition of the column to be inserted in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the elements of the new row.
yArgument to the matrix builder that determines the elements of the new column.
Returns
Determinant ratio \( \det(F^{(n+1)}) / \det(F^{(n)}) \).

Definition at line 1368 of file det_manip_basic.hpp.

◆ insert2()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::insert2 ( long i0,
long i1,
long j0,
long j1,
x_type const & x0,
x_type const & x1,
y_type const & y0,
y_type const & y1 )
inline

Insert two rows and columns.

Wrapper for try_insert2() followed by a complete_operation() call. See try_insert2() for details.

Parameters
i0,i1Positions of the rows to be inserted in the matrix \( F^{(n)} \).
j0,j1Positions of the columns to be inserted in the matrix \( F^{(n)} \).
x0,x1Arguments to the matrix builder that determine the elements of the new rows.
y0,y1Arguments to the matrix builder that determine the elements of the new columns.
Returns
Determinant ratio \( \det(F^{(n+2)}) / \det(F^{(n)}) \).

Definition at line 1392 of file det_manip_basic.hpp.

◆ insert2_at_end()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::insert2_at_end ( x_type const & x0,
x_type const & x1,
y_type const & y0,
y_type const & y1 )
inline

Insert two rows and columns at the end of the matrix.

Same as insert2() but with i0 and j0 set to size() and i1 and j1 set to size() + 1.

Parameters
x0,x1Arguments to the matrix builder that determine the elements of the new rows.
y0,y1Arguments to the matrix builder that determine the elements of the new columns.
Returns
Determinant ratio \( \det(F^{(n+2)}) / \det(F^{(n)}) \).

Definition at line 1405 of file det_manip_basic.hpp.

◆ insert_at_end()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::insert_at_end ( x_type const & x,
y_type const & y )
inline

Insert one row and column at the end of the matrix.

Same as insert() but with i and j set to size().

Parameters
xArgument to the matrix builder that determines the elements of the new row.
yArgument to the matrix builder that determines the elements of the new column.
Returns
Determinant ratio \( \det(F^{(n+1)}) / \det(F^{(n)}) \).

Definition at line 1381 of file det_manip_basic.hpp.

◆ insert_ratios()

template<typename FunctionType>
template<nda::Array X, nda::Array Y>
requires (nda::get_rank<X> == nda::get_rank<Y>)
auto triqs::det_manip::det_manip_basic< FunctionType >::insert_ratios ( long i,
long j,
X const & xs,
Y const & ys ) const->nda::array< value_type, nda::get_rank< X > >
inline

Compute independent single-insertion determinant ratios at position \( (i, j) \) for paired elements of xs and ys.

For each pair (xs[m], ys[m]) it computes the determinant ratio that a single try_insert() at position \( (i, j) \) would produce, without modifying the internal state. The inputs must be nda::Array objects with the same rank and shape, and the result has the same shape.

Template Parameters
Xnda::Array type of the first arguments.
Ynda::Array type of the second arguments.
Parameters
iPosition of the row to be inserted in the matrix \( F^{(n)} \).
jPosition of the column to be inserted in the matrix \( F^{(n)} \).
xsArray of first arguments to the matrix builder.
ysArray of second arguments to the matrix builder.
Returns
Array of determinant ratios with the same shape as xs and ys.

Definition at line 718 of file det_manip_basic.hpp.

◆ inverse_matrix() [1/2]

template<typename FunctionType>
nda::matrix_const_view< value_type > triqs::det_manip::det_manip_basic< FunctionType >::inverse_matrix ( ) const
inline

Get the full inverse matrix \( [F^{(n)}]^{-1} \).

The inverse is recomputed from scratch on demand and cached until the next operation.

Returns
The inverse matrix \( [F^{(n)}]^{-1} \).

Definition at line 409 of file det_manip_basic.hpp.

◆ inverse_matrix() [2/2]

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::inverse_matrix ( int i,
int j ) const
inline

Get an element of the inverse matrix \( [F^{(n)}]^{-1} \).

Parameters
iRow index.
jColumn index.
Returns
The matrix element \( [F^{(n)}]^{-1}_{ij} \).

Definition at line 421 of file det_manip_basic.hpp.

◆ inverse_matrix_internal_order() [1/2]

template<typename FunctionType>
nda::matrix_const_view< value_type > triqs::det_manip::det_manip_basic< FunctionType >::inverse_matrix_internal_order ( ) const
inline

Get the full inverse matrix in internal storage order.

For this class the internal order equals the user order, so this returns the same as inverse_matrix().

Returns
The inverse matrix \( [F^{(n)}]^{-1} \).

Definition at line 432 of file det_manip_basic.hpp.

◆ inverse_matrix_internal_order() [2/2]

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::inverse_matrix_internal_order ( int i,
int j ) const
inline

Get an element of the inverse matrix in internal storage order.

For this class the internal order equals the user order, so this returns the same as inverse_matrix(int, int).

Parameters
iRow index.
jColumn index.
Returns
The matrix element \( [F^{(n)}]^{-1}_{ij} \).

Definition at line 442 of file det_manip_basic.hpp.

◆ matrix() [1/2]

template<typename FunctionType>
matrix_type triqs::det_manip::det_manip_basic< FunctionType >::matrix ( ) const
inline

Get the matrix \( F^{(n)} \).

Returns
The matrix \( F^{(n)} \).

Definition at line 448 of file det_manip_basic.hpp.

◆ matrix() [2/2]

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::matrix ( int i,
int j ) const
inline

Get an element of the matrix \( F^{(n)} \).

Parameters
iRow index.
jColumn index.
Returns
The matrix element \( F^{(n)}_{ij} \).

Definition at line 459 of file det_manip_basic.hpp.

◆ reject_last_try()

template<typename FunctionType>
void triqs::det_manip::det_manip_basic< FunctionType >::reject_last_try ( )
inline

Reject the last try-operation.

All try_* operations have to be either accepted (via complete_operation()) or rejected.

Definition at line 1354 of file det_manip_basic.hpp.

◆ remove()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::remove ( long i,
long j )
inline

Remove one row and column.

Wrapper for try_remove() followed by a complete_operation() call. See try_remove() for details.

Parameters
iPosition of the row to be removed in the matrix \( F^{(n)} \).
jPosition of the column to be removed in the matrix \( F^{(n)} \).
Returns
Determinant ratio \( \det(F^{(n-1)}) / \det(F^{(n)}) \).

Definition at line 1416 of file det_manip_basic.hpp.

◆ remove2()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::remove2 ( long i0,
long i1,
long j0,
long j1 )
inline

Remove two rows and columns.

Wrapper for try_remove2() followed by a complete_operation() call. See try_remove2() for details.

Parameters
i0,i1Positions of the rows to be removed in the matrix \( F^{(n)} \).
j0,j1Positions of the columns to be removed in the matrix \( F^{(n)} \).
Returns
Determinant ratio \( \det(F^{(n-2)}) / \det(F^{(n)}) \).

Definition at line 1436 of file det_manip_basic.hpp.

◆ remove2_at_end()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::remove2_at_end ( )
inline

Remove the last two rows and columns of the matrix.

Same as remove2() but with i0 and j0 set to size() - 1 and i1 and j1 set to size() - 2.

Returns
Determinant ratio \( \det(F^{(n-2)}) / \det(F^{(n)}) \).

Definition at line 1447 of file det_manip_basic.hpp.

◆ remove_at_end()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::remove_at_end ( )
inline

Remove the last row and column of the matrix.

Same as remove() but with i and j set to size() - 1.

Returns
Determinant ratio \( \det(F^{(n-1)}) / \det(F^{(n)}) \).

Definition at line 1427 of file det_manip_basic.hpp.

◆ reserve()

template<typename FunctionType>
void triqs::det_manip::det_manip_basic< FunctionType >::reserve ( long new_size,
long new_k = 1 )
inline

Reserve memory to increase the capacity of the data storages.

Like for std::vector, this reserves memory for a bigger matrix size. It only reserves/resizes if the requested capacity is larger than the current one. It preserves the matrix but not the temporary working data, so it must NOT be called between a try_* function and the corresponding complete_operation().

Parameters
new_sizeNew capacity for the size of the matrix, i.e. the maximum number of rows and columns.
new_kUnused, kept for API compatibility with triqs::det_manip::det_manip.

Definition at line 220 of file det_manip_basic.hpp.

◆ roll_matrix()

template<typename FunctionType>
int triqs::det_manip::det_manip_basic< FunctionType >::roll_matrix ( RollDirection roll)
inline

Perform a circular shift permutation on the rows or columns of the matrix \( F^{(n)} \).

See RollDirection for the supported directions. This routine is not a try_* operation: it does make the modification (it rebuilds the matrix and updates the determinant directly) and does not need to be completed.

A circular shift permutation of a finite set is equivalent to \( N \) transpositions, where \( N \) is the size of the set. The sign of the permutation is therefore given by \( (-1)^{N-1} \).

Parameters
rollDirection of the roll operation.
Returns
-1 if the roll changes the sign of the determinant, 1 otherwise.

Definition at line 1518 of file det_manip_basic.hpp.

◆ size()

template<typename FunctionType>
auto triqs::det_manip::det_manip_basic< FunctionType >::size ( ) const
inline

Get the current size of the matrix.

Returns
Number of rows/columns of the matrix.

Definition at line 348 of file det_manip_basic.hpp.

◆ try_change_col()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_change_col ( long j,
y_type const & y )
inline

Try to change one column in the matrix \( F^{(n)} \).

The column at position \( j \) is replaced; its new elements are determined by the given matrix builder argument \( y \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
jPosition of the column to be changed in the matrix \( F^{(n)} \).
yArgument to the matrix builder that determines the new elements of the column.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1140 of file det_manip_basic.hpp.

◆ try_change_col_row()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_change_col_row ( long i,
long j,
x_type const & x,
y_type const & y )
inline

Try to change one column and one row in the matrix \( F^{(n)} \).

The row at position \( i \) and the column at position \( j \) are replaced; their new elements are determined by the given matrix builder arguments \( x \) and \( y \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPosition of the row to be changed in the matrix \( F^{(n)} \).
jPosition of the column to be changed in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the new elements of the row.
yArgument to the matrix builder that determines the new elements of the column.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1220 of file det_manip_basic.hpp.

◆ try_change_row()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_change_row ( long i,
x_type const & x )
inline

Try to change one row in the matrix \( F^{(n)} \).

The row at position \( i \) is replaced; its new elements are determined by the given matrix builder argument \( x \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPosition of the row to be changed in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the new elements of the row.
Returns
Determinant ratio \( \det(\widetilde{F}^{(n)}) / \det(F^{(n)}) \).

Definition at line 1179 of file det_manip_basic.hpp.

◆ try_insert()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_insert ( long i,
long j,
x_type const & x,
y_type const & y )
inline

Try to insert one row and column.

The row is inserted at position \( i \) and the column at position \( j \) in the matrix \( F^{(n)} \), with elements determined by the given matrix builder arguments \( x \) and \( y \). The current column \( j \) (resp. row \( i \)) becomes column \( j + 1 \) (resp. row \( i + 1 \)); inserting at \( n \) simply appends at the end ( \( 0 \leq i, j \leq n \)).

It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPosition of the row to be inserted in the matrix \( F^{(n)} \).
jPosition of the column to be inserted in the matrix \( F^{(n)} \).
xArgument to the matrix builder that determines the elements of the new row.
yArgument to the matrix builder that determines the elements of the new column.
Returns
Determinant ratio \( \det(F^{(n+1)}) / \det(F^{(n)}) \).

Definition at line 497 of file det_manip_basic.hpp.

◆ try_insert2()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_insert2 ( long i0,
long i1,
long j0,
long j1,
x_type const & x0_,
x_type const & x1_,
y_type const & y0_,
y_type const & y1_ )
inline

Try to insert two rows and columns.

The rows are inserted at positions \( i_0 \) and \( i_1 \) and the columns at positions \( j_0 \) and \( j_1 \) in the matrix \( F^{(n)} \), with elements determined by the given matrix builder arguments \( x_0, x_1, y_0, y_1 \) ( \( 0 \leq i_0,i_1,j_0,j_1 \leq n+1 \)).

It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
i0Position of the first row to be inserted in the matrix \( F^{(n)} \).
i1Position of the second row to be inserted in the matrix \( F^{(n)} \).
j0Position of the first column to be inserted in the matrix \( F^{(n)} \).
j1Position of the second column to be inserted in the matrix \( F^{(n)} \).
x0_Argument to the matrix builder that determines the elements of the first new row.
x1_Argument to the matrix builder that determines the elements of the second new row.
y0_Argument to the matrix builder that determines the elements of the first new column.
y1_Argument to the matrix builder that determines the elements of the second new column.
Returns
Determinant ratio \( \det(F^{(n+2)}) / \det(F^{(n)}) \).

Definition at line 574 of file det_manip_basic.hpp.

◆ try_insert_k()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_insert_k ( std::vector< long > i,
std::vector< long > j,
std::vector< x_type > x,
std::vector< y_type > y )
inline

Try to insert \( k \) rows and columns.

The new rows and columns are inserted at the positions given by the tuples \( \mathbf{i} \) and \( \mathbf{j} \), with elements determined by the matrix builder arguments \( \mathbf{x} \) and \( \mathbf{y} \) (each position \( i_l, j_l \) valid up to \( n + l \)).

It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPositions of the rows to be inserted in the matrix \( F^{(n)} \).
jPositions of the columns to be inserted in the matrix \( F^{(n)} \).
xArguments to the matrix builder that determine the elements of the new rows.
yArguments to the matrix builder that determine the elements of the new columns.
Returns
Determinant ratio \( \det(F^{(n+k)}) / \det(F^{(n)}) \).

Definition at line 763 of file det_manip_basic.hpp.

◆ try_refill()

template<typename FunctionType>
template<typename ArgumentContainer1, typename ArgumentContainer2>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_refill ( ArgumentContainer1 const & X,
ArgumentContainer2 const & Y )
inline

Try to fill the matrix \( F^{(n)} \) with new elements.

Builds a completely new matrix \( \widetilde{F}^{(\widetilde{n})} \) from the given matrix builder arguments \( \mathbf{x} \) and \( \mathbf{y} \) (with \( \widetilde{F}_{ij} = f(x_i, y_j) \)) and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Template Parameters
ArgumentContainer1Container type holding the first arguments.
ArgumentContainer2Container type holding the second arguments.
Parameters
XContainer holding the first matrix builder arguments.
YContainer holding the second matrix builder arguments.
Returns
Determinant ratio \( \det(\widetilde{F}^{(\widetilde{n})}) / \det(F^{(n)}) \).

Definition at line 1274 of file det_manip_basic.hpp.

◆ try_remove()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_remove ( long i,
long j )
inline

Try to remove one row and column.

The row at position \( i \) and the column at position \( j \) are removed from the matrix \( F^{(n)} \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPosition of the row to be removed in the matrix \( F^{(n)} \).
jPosition of the column to be removed in the matrix \( F^{(n)} \).
Returns
Determinant ratio \( \det(F^{(n-1)}) / \det(F^{(n)}) \).

Definition at line 885 of file det_manip_basic.hpp.

◆ try_remove2()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_remove2 ( long i0,
long i1,
long j0,
long j1 )
inline

Try to remove two rows and two columns.

The rows at positions \( i_0, i_1 \) and the columns at positions \( j_0, j_1 \) are removed from the matrix \( F^{(n)} \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
i0Position of the first row to be removed in the matrix \( F^{(n)} \).
i1Position of the second row to be removed in the matrix \( F^{(n)} \).
j0Position of the first column to be removed in the matrix \( F^{(n)} \).
j1Position of the second column to be removed in the matrix \( F^{(n)} \).
Returns
Determinant ratio \( \det(F^{(n-2)}) / \det(F^{(n)}) \).

Definition at line 946 of file det_manip_basic.hpp.

◆ try_remove_k()

template<typename FunctionType>
value_type triqs::det_manip::det_manip_basic< FunctionType >::try_remove_k ( std::vector< long > i,
std::vector< long > j )
inline

Try to remove \( k \) rows and columns.

The rows and columns at the positions given by the tuples \( \mathbf{i} \) and \( \mathbf{j} \) are removed from the matrix \( F^{(n)} \). It builds the candidate matrix and recomputes its determinant from scratch.

Warning
This routine does not make any modification. It has to be completed with complete_operation().
Parameters
iPositions of the rows to be removed in the matrix \( F^{(n)} \).
jPositions of the columns to be removed in the matrix \( F^{(n)} \).
Returns
Determinant ratio \( \det(F^{(n-k)}) / \det(F^{(n)}) \).

Definition at line 1038 of file det_manip_basic.hpp.

◆ foreach

template<typename FunctionType>
template<typename LambdaType>
void foreach ( det_manip_basic< FunctionType > const & d,
LambdaType const & func )
friend

For-each implementation for triqs::det_manip::det_manip_basic objects.

It loops over all elements of the inverse matrix and calls the given callable object for each element together with the corresponding arguments \( x_i \) and \( y_j \). The order of iteration is not fixed; it is optimised for memory traversal.

Template Parameters
LambdaTypeCallable type.
Parameters
dtriqs::det_manip::det_manip_basic object.
funcCallable object that takes three arguments: \( x_i \), \( y_j \), and \( [F^{(n)}]^{-1}_{ji} \).

Definition at line 472 of file det_manip_basic.hpp.

◆ h5_read

template<typename FunctionType>
void h5_read ( h5::group fg,
std::string subgroup_name,
det_manip_basic< FunctionType > & g )
friend

Read a triqs::det_manip::det_manip_basic object from HDF5.

Parameters
fgh5::group containing the subgroup to be read from.
subgroup_nameName of the subgroup.
gManipulator object to be read into.

Definition at line 197 of file det_manip_basic.hpp.

◆ h5_write

template<typename FunctionType>
void h5_write ( h5::group fg,
std::string subgroup_name,
det_manip_basic< FunctionType > const & g )
friend

Write a triqs::det_manip::det_manip_basic object to HDF5.

Parameters
fgh5::group containing the subgroup to be written to.
subgroup_nameName of the subgroup.
gManipulator object to be written.

Definition at line 180 of file det_manip_basic.hpp.


The documentation for this class was generated from the following file: