pyblock.qchem¶
pyblock.qchem.core¶
Translation of low-level objects in Block code.
-
exception
pyblock.qchem.core.
BlockError
¶ Bases:
Exception
-
class
pyblock.qchem.core.
BlockEvaluation
¶ Bases:
object
-
classmethod
eigen_values
(mat)¶ Return all eigenvalues of a StackSparseMatrix.
-
classmethod
expr_diagonal_eval
(expr, a, b, sts)¶ Evaluate the diagonal elements of the result of a symbolic operator expression. The diagonal elements are required for perconditioning in Davidson algorithm.
- Args:
- expr : OpString or OpCollection or ParaOpCollection
- The operator expression to evaluate.
- a : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in left block to its matrix representation.
- b : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in right block to its matrix representation.
- sts : VectorStateInfo
- StateInfo in which the result of the operator expression is represented.
- Returns:
- diag : DiagonalMatrix
-
classmethod
expr_eval
(expr, a, b, sts, q_label, nmat=0)¶ Evaluate the result of a symbolic operator expression. The operator expression is usually a sum of direct products of operators in left and right blocks.
- Args:
- expr : OpString or OpSum
- The operator expression to evaluate.
- a : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in left block to its matrix representation.
- b : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in right block to its matrix representation.
- sts : VectorStateInfo
- StateInfo in which the result of the operator expression is represented.
- q_label : DirectProdGroup
- Quantum label of the result operator (indicating how it changes the state quantum labels).
- Returns:
- nmat : StackSparseMatrix
-
classmethod
expr_expectation
(expr, a, b, ket, bra, work, sts)¶
-
classmethod
expr_multiply_eval
(expr, a, b, c, nwave, sts)¶ Evaluate the result of a symbolic operator expression applied on a wavefunction.
- Args:
- expr : OpString or OpCollection or ParaOpCollection
- The operator expression.
- a : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in left block to its matrix representation.
- b : dict(OpElement -> StackSparseMatrix)
- A map from operator symbol in right block to its matrix representation.
- c : Wavefunction
- The input wavefuction.
- nwave : Wavefunction
- The output wavefuction.
- sts : VectorStateInfo
- StateInfo in which the wavefuction is represented.
-
expr_perturbative_density_eval
(expr, a, b, c, d, forward, sts)¶
-
classmethod
left_contract
(i, optl, optd, mpo_info, mps_info, bra_mps_info=None)¶ Perform blocking MPO x MPO for left block.
- Args:
- i : int
- Site index.
- optl: OperatorTensor or DualOperatorTensor
- Contracted MPO operator tensor at previous left block.
- optd : OperatorTensor or DualOperatorTensor
- MPO operator tensor at dot block.
- mpo_info : MPOInfo
- MPOInfo object.
- mps_info : MPSInfo
- MPSInfo object.
- bra_mps_info : MPSInfo or None (if same as mps_info)
- MPSInfo object for bra state.
- Returns:
- new_opt : OperatorTensor or DualOperatorTensor
- Operator tensor in untruncated basis in current left block.
-
classmethod
left_right_contract
(i, optl, optr, mpo_info, tag)¶ Symbolically construct the super block MPO.
- Args:
- i : int
- Site index of first/left dot block.
- optl: OperatorTensor
- Contracted MPO operator at (enlarged) left block.
- optr: OperatorTensor
- Contracted MPO operator at (enlarged) right block.
- mpo_info : MPOInfo
- MPOInfo object.
- tag : str
- Extra tag for caching.
- Returns:
- new_opt : OperatorTensor
- Operator tensor for super block. This method does not evaluate the super block operator experssion.
-
classmethod
left_rotate
(i, opt, mpst, mps_info, bra_mpst=None, bra_mps_info=None)¶ Perform rotation <MPS|MPO|MPS> for left block.
- Args:
- i : int
- Site index.
- opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (untruncated) old basis.
- mpst : Tensor
- MPS tensor defining rotation in ket side.
- mps_info : MPSInfo
- MPSInfo object for ket state.
- bra_mpst : Tensor or None (if same as mpst)
- MPS tensor defining rotation in bra side.
- bra_mps_info : MPSInfo
- MPSInfo object for bra state.
- Returns:
- new_opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (truncated) new basis.
-
parallelizer
= None¶ Explicit evaluation of symbolic expression for operators.
-
classmethod
right_contract
(i, optr, optd, mpo_info, mps_info, bra_mps_info=None)¶ Perform blocking MPO x MPO for right block.
- Args:
- i : int
- Site index.
- optr: OperatorTensor or DualOperatorTensor
- Contracted MPO operator tensor at previous right block.
- optd : OperatorTensor or DualOperatorTensor
- MPO operator tensor at dot block.
- mpo_info : MPOInfo
- MPOInfo object.
- mps_info : MPSInfo
- MPSInfo object.
- bra_mps_info : MPSInfo or None (if same as mps_info)
- MPSInfo object for bra state.
- Returns:
- new_opt : OperatorTensor or DualOperatorTensor
- Operator tensor in untruncated basis in current right block.
-
classmethod
right_rotate
(i, opt, mpst, mps_info, bra_mpst=None, bra_mps_info=None)¶ Perform rotation <MPS|MPO|MPS> for right block.
- Args:
- i : int
- Site index.
- opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (untruncated) old basis.
- mpst : Tensor
- MPS tensor defining rotation in ket side.
- mps_info : MPSInfo
- MPSInfo object for ket state.
- bra_mpst : Tensor or None (if same as mpst)
- MPS tensor defining rotation in bra side.
- bra_mps_info : MPSInfo or None (if same as mps_info)
- MPSInfo object for bra state.
- Returns:
- new_opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (truncated) new basis.
-
simplifier
= <pyblock.qchem.simplifier.NoSimplifier object>¶
-
classmethod
tensor_rotate
(opt, sts, rmats)¶ Transform basis of MPO using rotation matrix.
- Args:
- opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (untruncated) old basis.
- sts : VectorStateInfo
- Old (untruncated) and new (truncated) basis.
- rmats : VectorVectorMatrix
- Rotation matrices for ket (or bra and ket).
- Returns:
- new_opt : OperatorTensor or DualOperatorTensor
- Operator tensor in (truncated) new basis.
-
classmethod
-
class
pyblock.qchem.core.
BlockHamiltonian
(*args, **kwargs)¶ Bases:
object
Initialization of block code.
- Attributes:
- output_level : int
- Output level of block code.
- point_group : str
- Point group of molecule.
- n_sites : int
- Number of sites/orbitals.
- n_electrons : int
- Number of electrons.
- target_s : Fraction
- SU(2) quantum number of target state.
- spatial_syms : [int]
- point group irrep number at each site.
- target_spatial_sym : int
- point group irrep number of target state.
- dot : int
- two-dot (2) or one-dot (1) scheme.
- t : TInt
- One-electron integrals.
- v : VInt
- Two-electron integrals.
- e : float
- Const term in energy.
-
static
block_operator_summary
(block)¶ Return a summary str of operators included in one Block (block code).
-
static
get
(fcidump, pg, su2, dot=2, output_level=0, memory=2000, page=None, omp_threads=1, **kwargs)¶
-
static
get_current_memory
()¶ Return current stack memory position.
-
get_site_operators
(m, op_set)¶ Return operator representations dict(OpElement -> StackSparseMatrix) at site m.
-
static
release_memory
()¶
-
static
set_current_memory
(m)¶ Reset current stack memory to given position.
-
class
pyblock.qchem.core.
BlockSymmetry
¶ Bases:
object
Including functions for translating quantum label related objects.
-
classmethod
from_spin_quantum
(sq)¶ Translate from SpinQuantum (block code) to
DirectProdGroup
.
-
classmethod
from_state_info
(state_info)¶ Translate from StateInfo (block code) to [(
DirectProdGroup
, int)].
-
classmethod
initial_state_info
(i=0)¶ Return StateInfo for site basis at site i.
-
classmethod
to_spin_quantum
(dpg)¶ Translate from
DirectProdGroup
to SpinQuantum (block code).
-
classmethod
to_state_info
(states)¶ Translate from [(
DirectProdGroup
, int)] to StateInfo (block code).
-
classmethod
pyblock.qchem.fcidump¶
FCIDUMP file and storage of integrals.
-
class
pyblock.qchem.fcidump.
GVInt
(n)¶ Bases:
pyblock.qchem.fcidump.TInt
General rank-4 array for two-electron integral storage.
- Attributes:
- n : int
- Number of orbitals.
- data : numpy.ndarray
- 1D flat array of size \(n^4\).
-
class
pyblock.qchem.fcidump.
TInt
(n)¶ Bases:
object
Symmetric rank-2 array (\(T_{ij} = T_{ji}\)) for one-electron integral storage.
- Attributes:
- n : int
- Number of orbitals.
- data : numpy.ndarray
- 1D flat array of size \(n(n+1)/2\).
-
copy
()¶
-
find_index
(i, j)¶ Find linear index from full indices (i, j).
-
class
pyblock.qchem.fcidump.
UVInt
(n)¶ Bases:
pyblock.qchem.fcidump.TInt
Symmetric rank-4 array (\(V_{ijkl} = V_{jikl} = V_{ijlk}\)) for two-electron integral storage.
- Attributes:
- n : int
- Number of orbitals.
- data : numpy.ndarray
- 1D flat array of size \(m^2\) where \(m=n(n+1)/2\).
-
find_index
(i, j, k, l)¶ Find linear index from full indices (i, j, k, l).
-
class
pyblock.qchem.fcidump.
VInt
(n)¶ Bases:
pyblock.qchem.fcidump.TInt
Symmetric rank-4 array (\(V_{ijkl} = V_{jikl} = V_{ijlk} = V_{klij}\)) for two-electron integral storage.
- Attributes:
- n : int
- Number of orbitals.
- data : numpy.ndarray
- 1D flat array of size \(m(m+1)/2\) where \(m=n(n+1)/2\).
-
find_index
(i, j, k, l)¶ Find linear index from full indices (i, j, k, l).
-
pyblock.qchem.fcidump.
read_fcidump
(filename)¶ Read FCI options and integrals from FCIDUMP file.
- Args:
- filename : str
- Returns:
- cont_dict : dict
- FCI options or input parameters.
- (t, v, e) : (TInt, VInt, float)
- One- and two-electron integrals and const energy.
-
pyblock.qchem.fcidump.
write_fcidump
(filename, h1e, h2e, nmo, nelec, nuc, ms, isym=1, orbsym=None, tol=1e-15)¶
pyblock.qchem.operator¶
Symbolic operators.
-
class
pyblock.qchem.operator.
OpElement
(name, site_index, factor=1, q_label=None)¶ Bases:
pyblock.qchem.operator.OpExpression
Single operator symbol.
- Attributes:
- name :
OpNames
- Type of the operator.
- site_index : () or tuple(int..)
- Site indices of the operator.
- factor : float
- scalar factor.
- q_label : DirectProdGroup
- Quantum label of the operator.
- name :
-
Cached
= {}¶
-
factor
¶
-
name
¶
-
static
parse
(expr)¶ Parse a str to operator symbol.
-
static
parse_site_index
(expr)¶
-
q_label
¶
-
site_index
¶
-
class
pyblock.qchem.operator.
OpExpression
¶ Bases:
object
-
class
pyblock.qchem.operator.
OpNames
¶ Bases:
enum.Enum
Operator Names.
-
A
= 12¶
-
AD
= 13¶
-
B
= 16¶
-
C
= 6¶
-
D
= 7¶
-
H
= 1¶
-
I
= 2¶
-
N
= 3¶
-
NN
= 4¶
-
NUD
= 5¶
-
P
= 14¶
-
PD
= 15¶
-
PDM1
= 18¶
-
Q
= 17¶
-
R
= 10¶
-
RD
= 11¶
-
S
= 8¶
-
SD
= 9¶
-
-
class
pyblock.qchem.operator.
OpString
(ops, factor=1)¶ Bases:
pyblock.qchem.operator.OpExpression
String of operator symbols representing direct product of single operator symbols.
- Attributes:
- ops : list(
OpElement
) - A list of single operator symbols.
- sign : int (1 or -1)
- Sign factor. With SU(2) factor considered
- ops : list(
-
factor
¶
-
op
¶
-
ops
¶
-
class
pyblock.qchem.operator.
OpSum
(strings)¶ Bases:
pyblock.qchem.operator.OpExpression
Sum of direct product of single operator symbols.
- Attributes:
- strings : list(
OpString
)
-
strings
¶
pyblock.qchem.mps¶
Matrix Product State for quantum chemistry calculations.
-
class
pyblock.qchem.mps.
LineCoupling
(n_sites, basis, empty, target)¶ Bases:
object
-
set_bond_dimension
(m, exact=False)¶ Truncate the renormalized basis, using the given bond dimension. Note that the ceiling is used for rounding for each quantum number, so the actual bond dimension is often larger than the given value.
-
set_bond_dimension_using_occ
(m, occ, bias=1)¶
-
tensor_product
(p, q)¶
-
-
class
pyblock.qchem.mps.
MPS
(lcp, center, dot=2, iprint=False, tensors=None)¶ Bases:
pyblock.tensor.tensor.TensorNetwork
Matrix Product State.
-
canonicalize
(random=False)¶ Canonicalization.
-
deep_copy
()¶ Deep copy.
-
fill_identity
()¶ Fill MPS reduced matrices with identity matrices whenever possible.
-
fit
(o, v)¶
-
static
from_tensor_network
(tn, mps_info, center, dot=2)¶
-
randomize
()¶ Fill MPS reduced matrices with random numbers in [0, 1).
-
update_line_coupling
()¶
-
zero_copy
()¶ Deep copy with zeros.
-
-
class
pyblock.qchem.mps.
MPSInfo
(lcp)¶ Bases:
object
-
from_left_rotation_matrix
(i, rot)¶ Translate rotation matrix (block code) in left block to rank-3
Tensor
.- Args:
- i : int
- Site index.
- rot : VectorMatrix
- Rotation matrix, defining the transformation from untruncated (but collected) basis to truncated basis.
- Returns:
- tensor : class:Tensor
-
from_right_rotation_matrix
(i, rot)¶ Translate rotation matrix (block code) in right block to rank-3
Tensor
.- Args:
- i : int
- Site index.
- rot : VectorMatrix
- Rotation matrix, defining the transformation from untruncated (but collected) basis to truncated basis.
- Returns:
- tensor : class:Tensor
-
from_wavefunction_fused
(i, wfn, sts=None)¶ Construct rank-2
Tensor
with fused indices from Wavefunction (block code).- Args:
- i : int
- Site index of first/left dot.
- wfn : Wavefunction
- Wavefunction.
- Returns:
- tensor : class:Tensor
- In two-dot scheme, the rank-2 tensor representing two-dot object. Both left and right rank indices are fused. No CG factor are generated. One-dot scheme is not implemented.
-
get_left_rotation_matrix
(i, tensor)¶ Translate rank-3
Tensor
to rotation matrix (block code) in left block.- Args:
- i : int
- Site index.
- tensor : class:Tensor
- MPS tensor.
- Returns:
- rot : VectorMatrix
- Rotation matrix, defining the transformation from untruncated (but collected) basis to truncated basis.
-
get_left_state_info
(i, left=None)¶ Construct StateInfo for left block [0..i] (used internally)
-
get_right_rotation_matrix
(i, tensor)¶ Translate rank-3
Tensor
to rotation matrix (block code) in right block.- Args:
- i : int
- Site index.
- tensor : class:Tensor
- MPS tensor.
- Returns:
- rot : VectorMatrix
- Rotation matrix, defining the transformation from untruncated (but collected) basis to truncated basis.
-
get_right_state_info
(i, right=None)¶ Construct StateInfo for right block [i..:attr:n_sites-1] (used internally)
-
get_wavefunction_fused
(i, tensor, dot, sts=None)¶ Construct Wavefunction (block code) from rank-2
Tensor
.- Args:
- i : int
- Site index of first/left dot.
- tensors : [Tensor]
- Rank-2
Tensor
with fused indices. - dot : int
- One-dot or two-dot (default) scheme.
- Returns:
- wfn : Wavefunction
-
update_local_left_block_basis
(i, left_block_basis)¶ Update renormalized basis at site i and associated StateInfo objects.
This will update for left block with sites [0..i] and [0..i+1]
- Args:
- i : int
- Center site, for determining assocated left and right blocks.
- left_block_basis : [(DirectProdGroup, int)]
- Renormalized basis for left block with sites [0..i].
-
update_local_left_state_info
(i, left=None)¶ Update StateInfo objects for left block ending at site i.
- Args:
- i : int
- Last site in the left block.
- Kwargs:
- left : StateInfo
- The (optional) StateInfo object for previous left block. Defaults to None.
- Returns:
- right : StateInfo
- The StateInfo object for current left block.
-
update_local_right_block_basis
(i, right_block_basis)¶ Update renormalized basis at site i and associated StateInfo objects.
This will update for right block with sites [i+1..:attr:n_sites-1] and [i..:attr:n_sites-1].
- Args:
- i : int
- Center site, for determining assocated left and right blocks.
- right_block_basis : [(DirectProdGroup, int)]
- Renormalized basis for right block with sites [i+1..:attr:n_sites-1].
-
update_local_right_state_info
(i, right=None)¶ Update StateInfo objects for right block starting at site i.
- Args:
- i : int
- First site in the right block.
- Kwargs:
- right : StateInfo
- The (optional) StateInfo object for previous right block. Defaults to None.
- Returns:
- left : StateInfo
- The StateInfo object for current right block.
-
-
pyblock.qchem.mps.
random_choice
(data, m)¶
pyblock.qchem.mpo¶
Matrix Product Operator for quantum chemistry calculations.
-
class
pyblock.qchem.mpo.
DualOperatorTensor
(lmat=None, rmat=None, ops=None, tags=None, contractor=None)¶ Bases:
pyblock.tensor.tensor.Tensor
MPO tensor or contracted MPO tensor with dual (left and right) representation.
-
copy
()¶ Return shallow copy of this object.
-
-
class
pyblock.qchem.mpo.
IdentityMPO
(hamil, iprint=False)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.mpo.
IdentityMPOInfo
(hamil, cache_contraction=True)¶ Bases:
pyblock.qchem.mpo.MPOInfo
-
class
pyblock.qchem.mpo.
LocalMPO
(hamil, op_name, site_index=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.mpo.
LocalMPOInfo
(hamil, op_name, site_index=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPOInfo
-
class
pyblock.qchem.mpo.
MPO
(hamil, iprint=False)¶
-
class
pyblock.qchem.mpo.
MPOInfo
(hamil, cache_contraction=True)¶ Bases:
object
-
class
pyblock.qchem.mpo.
OperatorTensor
(mat, ops, tags=None, contractor=None)¶ Bases:
pyblock.tensor.tensor.Tensor
Represent MPO tensor or contracted MPO tensor.
- Attributes:
- mat : numpy.ndarray(dtype=OpExpression)
- 2-D array of Symbolic operator expressions.
- ops : dict(OpElement -> StackSparseMatrix)
- Numeric representation of operator symbols.
When the object is the super block MPO,
ops
is a pair of dicts representing operator symbols for left and right blocks, respectively.
-
copy
()¶ Return shallow copy of this object.
-
class
pyblock.qchem.mpo.
ProdMPO
(hamil, opa_name, opb_name, opab_name, site_index_a=(), site_index_b=(), site_index_ab=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.mpo.
ProdMPOInfo
(hamil, opa_name, opb_name, opab_name, site_index_a=(), site_index_b=(), site_index_ab=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPOInfo
-
class
pyblock.qchem.mpo.
SquareMPO
(hamil, op_name, opsq_name, site_index=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.mpo.
SquareMPOInfo
(hamil, op_name, opsq_name, site_index=(), **kwargs)¶ Bases:
pyblock.qchem.mpo.MPOInfo
pyblock.qchem.contractor¶
Specialized MPS/MPO operations for DMRG.
-
class
pyblock.qchem.contractor.
BlockMultiplyH
(opt, sts, diag=True)¶ Bases:
object
A wrapper of Block.MultiplyH (block code) for Davidson algorithm.
- Attributes:
- opt : OperatorTensor
- The (symbolic) super block Hamiltonian.
- st : StateInfo
- StateInfo of super block.
- diag_mat : DiagonalMatrix
- Diagonal elements of super block Hamiltonian, in flatten form with no quantum labels.
-
apply
(other, result)¶ Perform \(\hat{H}|\psi\rangle\).
- Args:
- other : BlockWavefunction
- Input vector/wavefunction.
- result : BlockWavefunction
- Output vector/wavefunction.
-
diag
()¶ Returns Diagonal elements (for preconditioning).
-
diag_norm
()¶
-
expect
(ket, bra)¶
-
class
pyblock.qchem.contractor.
BlockWavefunction
(wave, factor=1.0)¶ Bases:
object
A wrapper of Wavefunction (block code) for Davidson algorithm.
-
clear_copy
()¶ Return a deep copy of this object, but all the matrix elements are set to zero.
-
copy
()¶ Return a deep copy of this object.
-
copy_data
(other)¶ Fill the matrix elements in this object with data from another
BlockWavefunction
object.
-
deallocate
()¶ Deallocate the memory associated with this object.
-
dot
(other)¶ Return dot product of two
BlockWavefunction
.
-
normalize
()¶ Normalization.
-
precondition
(ld, diag)¶ Apply precondition on this object.
- Args:
- ld : float
- Eigenvalue.
- diag : DiagonalMatrix
- Diagonal elements of Hamiltonian.
-
ref
¶
-
-
exception
pyblock.qchem.contractor.
ContractionError
¶ Bases:
Exception
-
class
pyblock.qchem.contractor.
DMRGContractor
(mps_info, mpo_info, simplifier=None, parallelizer=None, davidson_tol=5e-06)¶ Bases:
object
bra_mps_info is MPSInfo of some constant MPS.
-
apply
(opt, mpst)¶
-
bond_left
(tags={})¶
-
bond_right
(tags={})¶
-
bond_upper_limit_left
(tags={})¶
-
bond_upper_limit_right
(tags={})¶
-
contract
(tn, tags)¶ Tensor network contraction.
- Args:
- tn : TensorNetwork
- Part of tensor network to be contracted.
- tags : (str, int) or (str, )
- Tags of the tensor network to be contracted. If tags = (‘_LEFT’, i), the contraction is corresponding to blocking and renormalizing left block at site i. If tags = (‘_RIGHT’, i), the contraction is corresponding to blocking and renormalizing right block at site i. If tags = (‘_HAM’), the contraction is corresponding to blocking both left and right block and forming the super block hamiltonian.
- Returns:
- mpo : OperatorTensor
- The contracted MPO tensor.
-
eigs
(opt, mpst)¶ Davidson diagonalization.
- Args:
- opt : OperatorTensor
- Super block contracted operator tensor.
- mpst : Tensor
- Contracted MPS tensor in dot blocks.
- Returns:
- energy : float
- Ground state energy.
- v : class:Tensor
- In two-dot scheme, the rank-2 tensor representing two-dot object. Both left and right rank indices are fused. One-dot scheme is not implemented.
- ndav : int
- Number of Davidson iterations.
-
expect
(opt, brat, kett)¶
-
expo_apply
(opt, mpst, beta)¶
-
fuse_left
(i, tensor, original_form)¶
-
fuse_right
(i, tensor, original_form)¶
-
perturbative_noise
(opt, mpst)¶
-
post_sweep
()¶ Operations performed at the end of each DMRG sweep.
-
pre_sweep
()¶ Operations performed at the beginning of each DMRG sweep.
-
unfuse_left
(i, tensor)¶
-
unfuse_right
(i, tensor)¶
-
update_local_left_mps_info
(i, l_fused)¶ Update
info
for site i using the left tensor from SVD.
-
update_local_right_mps_info
(i, r_fused)¶ Update
info
for site i using the right tensor from SVD.
-
-
class
pyblock.qchem.contractor.
DMRGDataPage
(save_dir='node0', n_frames=1)¶ Bases:
pyblock.qchem.contractor.DataPage
Determine how to swap data between disk and memory for DMRG calculation.
-
activate
(tags, reset=False)¶ Activate one data page in memory for writing data.
-
clean
()¶ Delete all temporary files.
-
get
()¶
-
initialize
()¶ Allocate memory for all pages.
-
load
(tags)¶ Load data page from disk to memory, for reading data.
-
release
()¶ Deallocate memory for all pages.
-
save
(tags)¶ Save the data page in memory to disk.
-
unload
(tags)¶ Unload data page in memory for reading data.
-
pyblock.qchem.simplifier¶
Rules for simplifying symbolic operator expressions.
-
class
pyblock.qchem.simplifier.
AllRules
(su2=True)¶
-
class
pyblock.qchem.simplifier.
NoSimplifier
¶ Bases:
object
No simplification is performed.
-
simplify
(zipped)¶
-
-
class
pyblock.qchem.simplifier.
NoTransposeRules
(su2=True, rule=None)¶
-
class
pyblock.qchem.simplifier.
OpCollection
(uniq, linked=None)¶ Bases:
object
-
class
pyblock.qchem.simplifier.
OpLink
(op, trans, scale)¶ Bases:
object
-
class
pyblock.qchem.simplifier.
OpShell
(data)¶ Bases:
object
-
class
pyblock.qchem.simplifier.
PDM1Rules
(su2=True)¶
-
class
pyblock.qchem.simplifier.
Rule
(f=<function Rule.<lambda>>)¶ Bases:
object
-
class
pyblock.qchem.simplifier.
RuleSU2
¶ Bases:
object
-
class
A
(f=<function Rule.<lambda>>)¶
-
class
B
(f=<function Rule.<lambda>>)¶
-
class
D
(f=<function Rule.<lambda>>)¶
-
class
P
(f=<function Rule.<lambda>>)¶
-
class
PDM1
(f=<function Rule.<lambda>>)¶
-
class
Q
(f=<function Rule.<lambda>>)¶
-
class
R
(f=<function Rule.<lambda>>)¶
-
class
-
class
pyblock.qchem.simplifier.
RuleSZ
¶ Bases:
object
-
class
A
(f=<function Rule.<lambda>>)¶
-
class
B
(f=<function Rule.<lambda>>)¶
-
class
D
(f=<function Rule.<lambda>>)¶
-
class
P
(f=<function Rule.<lambda>>)¶
-
class
PDM1
(f=<function Rule.<lambda>>)¶
-
class
Q
(f=<function Rule.<lambda>>)¶
-
class
R
(f=<function Rule.<lambda>>)¶
-
class
pyblock.qchem.parallelizer¶
MPI parallelization.
-
class
pyblock.qchem.parallelizer.
ParaOpCollection
(uniq, linked=None, partial=None, collect=None, broadcast=None, bcast_all=False)¶
-
class
pyblock.qchem.parallelizer.
ParaProperty
(owner, repeated, repeated_num, partial)¶ Bases:
object
-
avail
¶
-
-
class
pyblock.qchem.parallelizer.
ParaRule
(size=<sphinx.ext.autodoc.importer._MockObject object>)¶ Bases:
object
pyblock.qchem.thermal¶
Setting up integral for calculating thermal quantities.
pyblock.qchem.occupation¶
Initialize quantum numbers using occupation numbers.
pyblock.qchem.ancilla¶
Ancilla approach for finite temperature simulation.
-
class
pyblock.qchem.ancilla.mps.
AncillaLineCoupling
(n_sites, basis, empty, target)¶ Bases:
pyblock.qchem.mps.LineCoupling
-
set_thermal_limit
()¶
-
-
class
pyblock.qchem.ancilla.mps.
AncillaMPS
(lcp, center, dot=2, iprint=False, tensors=None)¶ Bases:
pyblock.qchem.mps.MPS
-
fill_thermal_limit
()¶
-
pyblock.qchem.npdm¶
N-particle density matrix.
MPO for N-particle density matrix.
-
class
pyblock.qchem.npdm.mpo.
NRMMPO
(hamil, iprint=False)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.npdm.mpo.
NRMMPOInfo
(hamil, cache_contraction=True)¶ Bases:
pyblock.qchem.mpo.MPOInfo
-
class
pyblock.qchem.npdm.mpo.
PDM1MPO
(hamil, iprint=False)¶ Bases:
pyblock.qchem.mpo.MPO
-
class
pyblock.qchem.npdm.mpo.
PDM1MPOInfo
(hamil, cache_contraction=True)¶ Bases:
pyblock.qchem.mpo.MPOInfo