Skip to content

Commit

Permalink
Updates to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
obackhouse committed Sep 25, 2022
1 parent 26801a1 commit 270303d
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/00-ccsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import numpy as np
from pyscf import gto, scf

from ebcc import EBCC

mol = gto.Mole()
mol.atom = "H 0 0 0; F 0 0 1.1"
mol.basis = "cc-pvdz"
mol.build()

mf = scf.RHF(mol)
mf.kernel()

ccsd = EBCC(mf)
ccsd.kernel()
74 changes: 74 additions & 0 deletions examples/01-ebccsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import numpy as np
from pyscf import gto, scf

from ebcc import EBCC

np.random.seed(123)

mol = gto.Mole()
mol.atom = "H 0 0 0; F 0 0 1.1"
mol.basis = "cc-pvdz"
mol.build()

mf = scf.RHF(mol)
mf.kernel()

# Define boson energies and couplings to AO density:
nbos = 5
nmo = mf.mo_occ.size
g = np.random.random((nbos, nmo, nmo)) * 0.03
omega = np.random.random((nbos,)) * 5.0

# ,-------- Fermionic ansatz
# | ,------ Bosonic excitation amplitudes
# | | ,---- Rank of fermions in coupling term
# | | | ,-- Rank of bosons in coupling term
# v v v v
# ____ _ _ _
# CCSD-S-1-1: One-boson amplitudes and one-boson-one-fermion coupling
ccsd = EBCC(
mf,
ansatz="CCSD",
boson_excitations="S",
fermion_coupling_rank=1,
boson_coupling_rank=1,
omega=omega,
g=g,
)
ccsd.kernel()

# ,--------- Fermionic ansatz
# | ,------ Bosonic excitation amplitudes
# | | ,---- Rank of fermions in coupling term
# | | | ,-- Rank of bosons in coupling term
# v v v v
# ____ __ _ _
# CCSD-SD-1-1: Two-boson amplitudes and one-boson-one-fermion coupling
ccsd = EBCC(
mf,
ansatz="CCSD",
boson_excitations="SD",
fermion_coupling_rank=1,
boson_coupling_rank=1,
omega=omega,
g=g,
)
ccsd.kernel()

# ,--------- Fermionic ansatz
# | ,------ Bosonic excitation amplitudes
# | | ,---- Rank of fermions in coupling term
# | | | ,-- Rank of bosons in coupling term
# v v v v
# ____ __ _ _
# CCSD-SD-1-2: Two-boson amplitudes and two-boson-one-fermion coupling
ccsd = EBCC(
mf,
ansatz="CCSD",
boson_excitations="SD",
fermion_coupling_rank=1,
boson_coupling_rank=2,
omega=omega,
g=g,
)
ccsd.kernel()
18 changes: 18 additions & 0 deletions examples/02-eom_uccsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np
from pyscf import gto, scf

from ebcc import UEBCC

mol = gto.Mole()
mol.atom = "H 0 0 0; F 0 0 1.1"
mol.basis = "cc-pvdz"
mol.build()

mf = scf.UHF(mol)
mf.kernel()

ccsd = UEBCC(mf)
ccsd.kernel()

eom = ccsd.ip_eom()
eom.kernel()
16 changes: 16 additions & 0 deletions examples/03-cc2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import numpy as np
from pyscf import gto, scf

from ebcc import EBCC

mol = gto.Mole()
mol.atom = "H 0 0 0; F 0 0 1.1"
mol.basis = "cc-pvdz"
mol.build()

mf = scf.RHF(mol)
mf.kernel()

ccsd = EBCC(mf, ansatz="CC2")
ccsd.kernel()

0 comments on commit 270303d

Please sign in to comment.