Giter VIP home page Giter VIP logo

openfermion-dirac's Introduction

Dirac interfaced with Openfermion

Requirements

  • Dirac
  • Openfermion
  • all requirements for the aforementioned programs.

Installation

INSTALL DIRAC: http://diracprogram.org/doku.php

Note that one should modify the parameter variables in /path/to/dirac/utils/dirac_mointegral_export.F90 before compiling, such that

  logical, parameter     :: generate_full_list = .true.
  logical, parameter     :: generate_lower_triangular = .false.
  logical, parameter     :: sorting_wrt_energy = .true. ! sort wrt spinor's energy.
  logical, parameter     :: sorting_wrt_occupied = .false. ! sort wrt spinor's lowest occupied

INSTALL OPENFERMION : https://github.com/quantumlib/OpenFermion

INSTALL Openfermion-Dirac interface:

Clone the complete repository:

$ git clone https://github.com/bsenjean/Openfermion-Dirac.git

Build the code:

$ cd /path/to/Openfermion-Dirac/
$ pip install -e .

In /path/to/Openfermion-Dirac/openfermion_dirac/_run_dirac.py change the following :

  • Set your own path to pam (pam is the run_script of the Dirac program), which is called in the subprocess, or set /path/to/dirac/build to your .bash_profile.
  • Same for dirac_mointegral_export.x.
  • I realized that the last release of DIRAC may not have the complete version of dirac_mointegral_export.x. One might need to use dirac_openfermion_mointegral_export.x instead (which do not exist anymore in the developer version as it has been merged with dirac_mointegral_export.x). To make everything working (like the calculation of property integrals), please change dirac_mointegral_export.x to dirac_openfermion_mointegral_export.x in /path/to/Openfermion-Dirac/openfermion_dirac/_run_dirac.py.

Use

Different examples are furnished in the examples/ repository in python, as well as a tutorial in tutorial/. If one wants to play more with the tutorial, use jupyter notebook to do so.

openfermion-dirac's People

Contributors

bsenjean avatar lucasvisscher avatar

Stargazers

Markus Rauhalahti avatar WILSON O FONSECA avatar dinngoman avatar Hixiz avatar  avatar  avatar Rishabh Singh avatar HLedgerBot avatar marm314 avatar Ilia Maltsev avatar  avatar Rugantio Costa avatar Ryan Babbush avatar

Watchers

Tom O'Brien avatar  avatar

openfermion-dirac's Issues

Interface with DIRAC21 release: bug for CCSD ?

Now that we can use DIRAC21, I noticed some bugs that need to be fixed. For instance, the CCSD energy of the H2 molecule in the minimal basis is now wrong. Before using DIRAC21, one had the following energies (as shown in the tutorial on github):

Without NUCMOD:
Hartree-Fock energy of -1.0661086545096314 Hartree.
MP2 energy of -1.086665369123029 Hartree.
CCSD energy of -1.101150334318182 Hartree.

With NUCMOD:
Hartree-Fock energy of -1.0661086554855703 Hartree.
MP2 energy of -1.086665370107966 Hartree.
CCSD energy of -1.100909326556841 Hartree (not entirely converged with 30 iterations)

Now, we have:
Without NUCMOD:
Hartree-Fock energy of -1.0661086545096314 Hartree.
MP2 energy of -1.086665369123031 Hartree.
CCSD energy of -1.084147034280662 Hartree. (not converged)

With NUCMOD:
Hartree-Fock energy of -1.0661086554855708 Hartree.
MP2 energy of -1.086665370107968 Hartree.
CCSD energy of -1.210059543226092 Hartree.

The different is huge, and I am confident that the previous result is correct as it was extremely close to the FCI one.

I attach the 2 output files with DIRAC21 and with and without NUCMOD.
I also enclose the files where I used DIRAC20 to compare.

H2_STO-3G_R1.0_ccsd_NUCMOD.txt
H2_STO-3G_R1.0_ccsd.txt
H2_STO-3G_R1.0_ccsd_NUCMOD_DIRAC20.txt
H2_STO-3G_R1.0_ccsd_DIRAC20.txt

examples fail: cannot import name 'eigenspectrum' from 'openfermion.utils'

Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-OpenFermion-Dirac/work-py39/Openfermion-Dirac-cc08a66/examples/H4.py", line 3, in <module>
    from openfermion.utils import eigenspectrum
ImportError: cannot import name 'eigenspectrum' from 'openfermion.utils' (/usr/local/lib/python3.9/site-packages/openfermion/utils/__init__.py)

OpenFermion-1.5.1
Python-3.9
FreeBSD 13.1

CASCI with OpenFermion-Dirac21

CASCI calculations are now wrong in some cases, like the LiH molecule. Before, we had:

Hartree-Fock energy of -7.8309055884430281 Hartree.
The spin-orbitals and their associated energy:{1: -2.3611878858249176, 3: -0.25010666181875163, 5: 0.07327903918143776, 7: 0.16210566454657324, 9: 0.1621056645465733, 11: 0.4326451477796373, 2: -2.3611878858249176, 4: -0.25010666181875163, 6: 0.07327903918143776, 8: 0.16210566454657324, 10: 0.1621056645465733, 12: 0.4326451477796373}
CASCI energies: [-7.86108778 -7.78953175 -7.78953175 ... 0.79376582 1.28714689
1.61687514]

And now:
Hartree-Fock energy of -7.8309055884430441 Hartree.
The spin-orbitals and their associated energy:b'{1: -2.361187885824919, 2: -0.25010666181875174, 3: 0.07327903918143933, 4: 0.16210566454657374, 5: 0.16210566454657382, 6: 0.4326451477796374, 7: -2.361187885824919, 8: -0.25010666181875174, 9: 0.07327903918143933, 10: 0.16210566454657374, 11: 0.16210566454657382, 12: 0.4326451477796374}'
CASCI energies: [-11.18701071 -11.08526707 -11.08526707 ... -0.20254019 -0.20254019
0.79376582]

This should be fixed easily, but I have to understand what happened. To be continued...

CC amplitudes

CC amplitudes are not yet fully working. I only managed to make them work for relativistic calculation, but the ordering does not match the one of OpenFermion-Psi4 or OpenFermion-PySCF. Some additional checks and fixes have to be made.

Multiplicity

Multiplicity can be set in the molecular object but does actually not appear anywhere in the DIRAC input file. How to tell DIRAC which spin-state one is interested in ?
This should be fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.