Python API reference¶
- class chemtensor.MPO¶
Bases:
objectMPO object
- a¶
local tensors
- bond_dims¶
virtual bond dimensions
- bond_quantum_numbers()¶
Return the quantum numbers of the i-th virtual bond.
- coeffmap¶
internal coefficient map of the MPO
- d¶
local physical dimension of each site
- nsites¶
number of sites
- qsite¶
physical quantum numbers at each site
- to_matrix()¶
Construct the (dense) matrix representation of the matrix product operator on the full Hilbert space.
- class chemtensor.MPS¶
Bases:
objectMPS object
- a¶
local tensors
- bond_dims¶
virtual bond dimensions
- bond_quantum_numbers()¶
Return the quantum numbers of the i-th virtual bond.
- d¶
local physical dimension of each site
- nsites¶
number of sites
- qsite¶
physical quantum numbers at each site
- to_statevector()¶
Construct the vector representation of the matrix product state on the full Hilbert space.
- class chemtensor.OpChain¶
Bases:
objectOpChain object
- cid¶
coefficient index
- istart¶
first lattice site the operator chain acts on
- length¶
length of the operator chain (number of local operators)
- oids¶
list of local operator IDs
- qnums¶
interleaved bond quantum numbers, including a leading and trailing quantum number
- class chemtensor.TTNO¶
Bases:
objectTTNO object
- a¶
local tensors
- bond_dim()¶
Return the dimension of the virtual bond between two neighboring sites.
- bond_quantum_numbers()¶
Return the quantum numbers of the virtual bond between two neighboring sites.
- coeffmap¶
internal coefficient map of the TTNO
- d¶
local physical dimension of each site
- nsites¶
number of sites
- nsites_branching¶
number of branching sites
- nsites_physical¶
number of physical sites
- qsite¶
physical quantum numbers at each site
- to_matrix()¶
Construct the (dense) matrix representation of the matrix product operator on the full Hilbert space.
- class chemtensor.TTNS¶
Bases:
objectTTNS object
- a¶
local tensors
- bond_dim()¶
Return the dimension of the virtual bond between two neighboring sites.
- bond_quantum_numbers()¶
Return the quantum numbers of the virtual bond between two neighboring sites.
- local_dimension()¶
Return the local physical dimension at a site.
- max_bond_dim¶
maximum virtual bond dimension
- nsites¶
number of sites
- nsites_branching¶
number of branching sites
- nsites_physical¶
number of physical sites
- quantum_number_sector¶
quantum number sector
- to_statevector()¶
Construct the vector representation of the tree tensor networks state on the full Hilbert space.
- chemtensor.bug_tree_time_step()¶
Perform a Basis-Update and Galerkin (BUG) rank-adaptive tree tensor network integration step. Syntax: bug_tree_time_step(state: TTNS, op: TTNO, i_root: int, prefactor, dt: float, rel_tol_compress=1e-5, max_vdim=int_max)
- chemtensor.construct_bose_hubbard_1d_mpo()¶
Construct an MPO representation of the Bose-Hubbard Hamiltonian with nearest-neighbor hopping on a one-dimensional lattice. Syntax: construct_bose_hubbard_1d_mpo(nsites: int, d: int, t: float, u: float, mu: float)
- chemtensor.construct_fermi_hubbard_1d_mpo()¶
Construct an MPO representation of the Fermi-Hubbard Hamiltonian with nearest-neighbor hopping on a one-dimensional lattice. Syntax: construct_fermi_hubbard_1d_mpo(nsites: int, t: float, u: float, mu: float)
- chemtensor.construct_heisenberg_xxz_1d_mpo()¶
Construct an MPO representation of the XXZ Heisenberg Hamiltonian ‘sum J (X X + Y Y + D Z Z) - h Z’ on a one-dimensional lattice. Syntax: construct_heisenberg_xxz_1d_mpo(nsites: int, J: float, D: float, h: float)
- chemtensor.construct_ising_1d_mpo()¶
Contruct an MPO representation of the Ising Hamiltonian ‘sum J Z Z + h Z + g X’ on a one-dimensional lattice. Syntax: construct_ising_1d_mpo(nsites: int, J: float, h: float, g: float)
- chemtensor.construct_molecular_hamiltonian_mpo()¶
Construct a molecular Hamiltonian as MPO, using physicists’ convention for the interaction term: H = sum_{i,j} t_{i,j} ad_i a_j + 1/2 sum_{i,j,k,l} v_{i,j,k,l} ad_i ad_j a_l a_k Syntax: construct_molecular_hamiltonian_mpo(tkin, vint, optimize=False)
- chemtensor.construct_mpo_from_opchains()¶
Construct an MPO from a list of operator chains. Syntax: construct_mpo_from_opchains(dtype: str, nsites: int, chains, opmap, coeffmap, qsite)
- chemtensor.construct_random_mps()¶
Construct a matrix product state with random normal tensor entries, given an overall quantum number sector and maximum virtual bond dimension. Syntax: construct_random_mps(dtype, nsites, qsite, qnum_sector, max_vdim=256, rng_seed=42, normalize=True)
- chemtensor.construct_random_ttns()¶
Construct a tree tensor network state with random normal tensor entries, given the tree topology, an overall quantum number sector and maximum virtual bond dimension. Syntax: construct_random_ttns(dtype, nsites_physical, tree_neighbors, qsites, qnum_sector, max_vdim=256, rng_seed=42, normalize=True)
- chemtensor.construct_spin_molecular_hamiltonian_mpo()¶
Construct a molecular Hamiltonian as MPO assuming a spin orbital basis, using physicists’ convention for the interaction term: H = sum_{i,j,sigma} t_{i,j} ad_{i,sigma} a_{j,sigma} + 1/2 sum_{i,j,k,l,sigma,tau} v_{i,j,k,l} ad_{i,sigma} ad_{j,tau} a_{l,tau} a_{k,sigma} Syntax: construct_spin_molecular_hamiltonian_mpo(tkin, vint, optimize=False)
- chemtensor.construct_ttno_from_opchains()¶
Construct a TTNO from a list of operator chains. Syntax: construct_ttno_from_opchains(dtype: str, nsites_physical: int, tree_neighbors, chains, opmap, coeffmap, qsite)
- chemtensor.decode_quantum_number_pair()¶
Decode a quantum number into two separate quantum numbers. Syntax: decode_quantum_number_pair(qnum: int)
- chemtensor.dmrg()¶
Run the two-site DMRG algorithm for the Hamiltonian provided as MPO. Syntax: dmrg(mpo, num_sweeps=5, maxiter_lanczos=20, tol_split=1e-10, max_vdim=256, qnum_sector=0, rng_seed=42)
- chemtensor.encode_quantum_number_pair()¶
Encode a pair of quantum numbers into a single quantum number. Syntax: encode_quantum_number_pair(qa: int, qb: int)
- chemtensor.get_max_openmp_threads()¶
Get the maximum number of OpenMP threads, or 0 if OpenMP is not available.
- chemtensor.operator_average_coefficient_gradient()¶
Compute the value and gradient of <chi | op | psi> with respect to the internal MPO coefficients. Syntax: operator_average_coefficient_gradient(op: MPO, psi: MPS: chi: MPS)