sokolov-group / sqa_plus

Enhanced implementation of Second Quantization Algebra
GNU General Public License v3.0
7 stars 0 forks source link

sqa_plus: SecondQuantizationAlgebra Plus

This program is intended to automate many of the tedious manipulations that one encounters when working in second quantization. To use it, be sure that your $PYTHONPATH variable includes this directory. Then, in the Python2 interpreter or in a Python2 script, use a command such as:

import sqa_plus

SecondQuantizationAlgebra Plus Capabilities

To see how to use core SecondQuantizationAlgebra capabilities, such as the definition of indexes, operators and terms, and algebraic functions, such as Normal Ordering, please visit the original TUTORIAL file.

Multireference Algebraic Diagrammatic Construction (MR-ADC) Theory Automation

Spin-Orbital Effective Hamiltonian and Operators

Dyall Hamiltonian (sqa_plus.dyallH), Effective Hamiltonians up to second-order (sqa_plus.Heff), T amplitudes operators (sqa_plus.Tamplitude) and V perturbation operators (sqa_plus.Vperturbation) can be obtained automatically.

Spin-Integrated Effective Hamiltonian and Operators

Spin-integrated effective Hamiltonians and operators can now be obtained by functions implemented in sqaHeff.py. Dyall Hamiltonian (sqa_plus.dyallH), Effective Hamiltonians up to second-order (sqa_plus.Heff), T amplitudes operators (sqa_plus.Tamplitude) and V perturbation operators (sqa_plus.Vperturbation) are included. The spin-integrated basis can be globally selected by using sqa_plus.options.spin_integrated = True. By default, sqa_plus assumes the spin-orbital basis (sqa_plus.options.spin_orbital = True).

sqa_plus.options.spin_integrated = True
terms_Heff0_si = sqa_plus.Heff(0)        # Spin-integrated zeroth-order Heff

Core-Valence Separation (CVS) approximattion using SQA+ Equation Generator

In a similar design to the choice of the spin basis, the CVS approximation can be selected by using sqa_plus.options.cvs_approach = True. It will set globally all the implemented operators (sqaHeff.py, sqa_plus.dyallH, sqa_plus.Heff, sqa_plus.Tamplitude, and sqa_plus.Vperturbation) to assume the CVS approximation.

In the SQA+ language, the CVS approximation decouple the options.core_type type indices in two new types of indices: options.cvs_core_type and options.cvs_valence_type. Then, core indices defined by the user must be of these types.

Using summed (dummy) indices lists: sqa_plus.indexLists

Besides the usage of sqa_plus.index class to define dummy indices, we provide an automated way to generate unique indices. The sqa_plus.indexLists object can be used to create dummy indices, free of conflict with SQA+ implemented operators. New indices can be obtained using the new_index() method.

# Examples of sqa_plus.indexLists usage
cvs_core_ind_1 = sqa_plus.indexLists.cvs_core.new_index()
active_ind_1 = sqa_plus.indexLists.active.new_index()
virtual_alpha_ind_1 = sqa_plus.indexLists.virtual_alpha.new_index()

Dummy index types supported

Spin-Adapted Equation Generator

Spin-Adaptation Automation from Spin-Integrated Equations: sqa_plus.ConvertSpinIntegratedToSpinAdapted

The function sqa_plus.convertSpinIntegratedToAdapted allows the automated conversion of spin-integrated terms to quantitites in the spin-adapted formulation. Include the spin-adaptation of 1e- and 2e- integrals, and reduced density matrices (up to 4-RDMs).

Example

# Define spin-integrated Zeroth-order Heff
sqa_plus.options.spin_integrated = True
terms_Heff0_si = sqa_plus.Heff(0)

# Evaluate terms
terms_Heff0_si = sqa_plus.matrixBlock(terms_Heff0_si)

# Convert to spin-adapted formulation
terms_Heff0_sa = sqa_plus.convertSpinIntegratedToAdapted(terms_Heff0_si)

The evaluated terms of the spin-integrated effective Hamiltonian in terms_Heff0_si are:

 (   1.00000) E_fc(Const.) 
 (   1.00000) h(x,y) cre(x) des(y) 
 (   1.00000) h(x,y) cre(x) des(y) 
 (   1.00000) v(i,x,i,y) cre(x) des(y) 
 (   1.00000) v(i,x,i,y) cre(x) des(y) 
 (   1.00000) v(i,x,i,y) cre(x) des(y) 
 (   1.00000) v(i,x,i,y) cre(x) des(y) 
 (  -0.25000) v(x,y,z,w) cre(x) cre(y) des(z) des(w) 
 (  -1.00000) v(x,y,z,w) cre(x) cre(y) des(z) des(w) 
 (  -0.25000) v(x,y,z,w) cre(x) cre(y) des(z) des(w) 

After the spin-adaptation procedure, terms_Heff0_sa should contain:

 (   1.00000) E_fc(Const.) 
 (   1.00000) h(x,y) rdm(x,y) 
 (   2.00000) v(i,i,x,y) rdm(x,y) 
 (  -1.00000) v(i,x,y,i) rdm(x,y) 
 (   0.50000) v(x,y,z,w) rdm(x,z,y,w) 

Note that sqa_plus.convertSpinIntegratedToAdapted will globally set sqa_plus.options.spin_adapted = True) and changes 2e- integrals and RDMs to the chemists' notation (sqa_plus.options.chemists_notation = True).

Matrix Block Evaluation: sqa_plus.matrixBlock

Automates the evaluation of terms applying normal-order to all active-space creation ahd annihilation operators with respect to physical vacuum, normal-order core creation and annihilation operators relative to the Fermi vaccum, and evaluate expectation values with respect to the active-space states.

# Define spin-orbital Zeroth-order Heff
terms_Heff0 = sqa_plus.Heff(0)

# Evaluate terms
terms_Heff0 = matrixBlock(terms_Heff0)

Intermediates Generator

Intermediates function: sqa_plus.genIntermediates

Intermediates code requires NumPy scientific computation package installed.

Export terms in NumPy's Einsum Notation: sqa_plus.genEinsum

Translates terms and SQA+ objects to Numpy's Einsum notation, ready to be used in Python codes. The sqa_plus.genEinsum function has options setted by positional arguments.

sqa_plus.genEinsum(terms, lhs_string = None, indices_string = None, suffix = None,
                   trans_indices_string = None, intermediate_list = None, help = False, **tensor_rename):

Aditionally, options for genEinsum can be selected using the object sqa_plus.options

Credits

SecondQuantizationAlgebra

SecondQuantizationAlgebra was originally developed by Eric Neuscamman eric.neuscamman@gmail.com

In addition, any modification or use of this software should cite the following paper:

  E. Neuscamman, T. Yanai, and G. K.-L. Chan.
  J. Chem. Phys. 130, 124102 (2009)

SecondQuantizationAlgebra Plus

MR-ADC Automation

Intermediates Generator

Spin-Adaptation Automation

Core-Valence Separation Approximation