Skip to content

Is there a way to get partial trace of density matrix? #78

Answered by hczhai
fqian5 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for providing the detailed information. What your figure suggests is the contraction of MPS tensors, which can be done using the following script:

import numpy as np
from pyblock2._pyscf.ao2mo import integrals as itg
from pyblock2.driver.core import DMRGDriver, SymmetryTypes
from pyblock2.algebra.io import MPSTools
from pyblock2.algebra.core import Tensor, MPS

from pyscf import gto, scf

mol = gto.M(atom="N 0 0 0; N 0 0 1.1", basis="sto3g", symmetry="d2h", verbose=0)
mf = scf.RHF(mol).run(conv_tol=1E-14)
ncas, n_elec, spin, ecore, h1e, g2e, orb_sym = itg.get_rhf_integrals(mf,
    ncore=0, ncas=None, g2e_symm=8)

driver = DMRGDriver(scratch="./tmp", symm_type=SymmetryTypes.SZ, n_th…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@fqian5
Comment options

Comment options

You must be logged in to vote
1 reply
@fqian5
Comment options

Answer selected by fqian5
Comment options

You must be logged in to vote
4 replies
@hczhai
Comment options

@fqian5
Comment options

@hczhai
Comment options

@fqian5
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants