Skip to content

Applying a general (unitary) orbital rotation to MPS #48

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

You must be logged in to vote

Hi Yannic,

Thanks for your interest in using block2 for your research. Here is an example python script for doing orbital rotation with -1 determinant rotation matrices:

from pyscf import gto, scf, lo
import scipy.linalg
import numpy as np

mol = gto.M(atom='N 0 0 0; N 0 0 1.1', basis='sto3g', symmetry='c1')
mf = scf.RHF(mol).run()

# localize orbitals
def scdm(coeff, overlap):
    aux = lo.orth.lowdin(overlap)
    no = coeff.shape[1]
    ova = coeff.T @ overlap @ aux
    piv = scipy.linalg.qr(ova, pivoting=True)[2]
    bc = ova[:, piv[:no]]
    ova = np.dot(bc.T, bc)
    s12inv = lo.orth.lowdin(ova)
    return coeff @ bc @ s12inv

# HF orbitals (old basis)
mo_coeff = mf.mo_coeff

# Local…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by yannra
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