├── requirements.txt ├── dev_tools ├── pip-list └── packaging │ ├── produce-package.sh │ ├── verify-published-package.sh │ └── publish-dev-package.sh ├── MANIFEST.in ├── openfermionpyscf ├── _version.py ├── __init__.py ├── _run_pyscf_test.py ├── tests │ ├── _run_pyscf_test.py │ └── _pyscf_molecular_data_test.py ├── _run_pyscf.py └── _pyscf_molecular_data.py ├── setup.py ├── SUPPORT.md ├── .gitignore ├── .github ├── workflows │ ├── ci.yml │ └── ossf-scorecard.yaml └── SECURITY.md ├── NOTICE ├── examples ├── generate_data.py ├── generate_diatomic.py ├── plotter.py └── openfermionpyscf_demo.ipynb ├── CODE_OF_CONDUCT.md ├── README.rst ├── CONTRIBUTING.md └── LICENSE /requirements.txt: -------------------------------------------------------------------------------- 1 | openfermion>=1.0 2 | pyscf 3 | -------------------------------------------------------------------------------- /dev_tools/pip-list: -------------------------------------------------------------------------------- 1 | pytest 2 | pyscf 3 | openfermion 4 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include NOTICE 3 | include MANIFEST.in 4 | include README.rst 5 | include requirements.txt 6 | include setup.py 7 | 8 | recursive-include openfermionpyscf *.py 9 | -------------------------------------------------------------------------------- /openfermionpyscf/_version.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """Define version number here and read it from setup.py automatically""" 14 | __version__ = "0.5" 15 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | from setuptools import setup, find_packages 4 | 5 | # This reads the __version__ variable from openfermionpyscf/_version.py 6 | exec(open('openfermionpyscf/_version.py').read()) 7 | 8 | # Readme file as long_description: 9 | long_description = io.open('README.rst', encoding='utf-8').read() 10 | 11 | # Read in requirements.txt 12 | requirements = open('requirements.txt').readlines() 13 | requirements = [r.strip() for r in requirements] 14 | 15 | setup( 16 | name='openfermionpyscf', 17 | version=__version__, 18 | author='The OpenFermion Developers', 19 | author_email='help@openfermion.org', 20 | url='http://www.openfermion.org', 21 | description='A plugin allowing OpenFermion to interface with PySCF.', 22 | long_description=long_description, 23 | install_requires=requirements, 24 | license='Apache 2', 25 | packages=find_packages() 26 | ) 27 | -------------------------------------------------------------------------------- /openfermionpyscf/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """ 14 | OpenFermion plugin to interface with PySCF. 15 | """ 16 | 17 | from ._pyscf_molecular_data import PyscfMolecularData 18 | 19 | from ._run_pyscf import ( 20 | generate_molecular_hamiltonian, 21 | prepare_pyscf_molecule, 22 | run_pyscf) 23 | 24 | from ._version import __version__ 25 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | Thank you for your interest in this project! If you are experiencing problems 4 | or have questions, the following are some suggestions for how to get help. 5 | 6 | > [!NOTE] 7 | > Before participating in our community, please read our [code of 8 | > conduct](CODE_OF_CONDUCT.md). By interacting with this repository, 9 | > organization, or community, you agree to abide by its terms. 10 | 11 | ## Report an issue or request a feature 12 | 13 | To report an issue or request a feature, please first search the [issue tracker 14 | on GitHub](https://github.com/quantumlib/OpenFermion-PySCF/issues) to check if 15 | there is already an open issue identical or similar to your bug report/feature 16 | request. If there is none, go ahead and file a new issue in the issue tracker. 17 | 18 | ## Contact the maintainers 19 | 20 | For any questions or concerns not addressed here, please email 21 | [quantum-oss-maintainers@google.com](mailto:quantum-oss-maintainers@google.com). 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *lastfailed 3 | *coverage 4 | 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | .pytest_cache/ 43 | htmlcov/ 44 | .tox/ 45 | .coverage 46 | .coverage.* 47 | .cache 48 | nosetests.xml 49 | coverage.xml 50 | *.cover 51 | .hypothesis/ 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | 59 | # Jupyter Notebook 60 | .ipynb_checkpoints 61 | 62 | # pyenv 63 | .python-version 64 | 65 | # Environments 66 | .env 67 | .venv 68 | env/ 69 | venv/ 70 | ENV/ 71 | 72 | # mkdocs documentation 73 | /site 74 | 75 | *.lprof 76 | 77 | # no pycharm 78 | .idea* 79 | -------------------------------------------------------------------------------- /openfermionpyscf/_run_pyscf_test.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | import openfermion 14 | import openfermionpyscf 15 | 16 | 17 | def test_load_molecular_hamiltonian(): 18 | geometry = [('Li', (0., 0., 0.)), ('H', (0., 0., 1.4))] 19 | 20 | lih_hamiltonian = openfermionpyscf.generate_molecular_hamiltonian( 21 | geometry, 'sto-3g', 1, 0, 2, 2) 22 | assert openfermion.count_qubits(lih_hamiltonian) == 4 23 | 24 | lih_hamiltonian = openfermionpyscf.generate_molecular_hamiltonian( 25 | geometry, 'sto-3g', 1, 0, 2, 3) 26 | assert openfermion.count_qubits(lih_hamiltonian) == 6 27 | 28 | lih_hamiltonian = openfermionpyscf.generate_molecular_hamiltonian( 29 | geometry, 'sto-3g', 1, 0, None, None) 30 | assert openfermion.count_qubits(lih_hamiltonian) == 12 31 | -------------------------------------------------------------------------------- /openfermionpyscf/tests/_run_pyscf_test.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """Tests many modules to call pyscf functions.""" 14 | from __future__ import absolute_import 15 | 16 | from openfermion.chem import MolecularData 17 | from openfermionpyscf import run_pyscf 18 | from openfermionpyscf import PyscfMolecularData 19 | 20 | 21 | geometry = [('H', (0., 0., 0.)), ('H', (0., 0., 0.7414))] 22 | basis = '6-31g' 23 | multiplicity = 1 24 | charge = 0 25 | molecule = MolecularData(geometry, 26 | basis, 27 | multiplicity, 28 | charge) 29 | 30 | 31 | def test_run_pyscf(): 32 | new_mole = run_pyscf(molecule, 33 | run_scf=True, 34 | run_mp2=True, 35 | run_cisd=True, 36 | run_ccsd=True, 37 | run_fci=True, 38 | verbose=1) 39 | assert isinstance(new_mole, PyscfMolecularData) 40 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | name: Continuous Integration 17 | 18 | on: [pull_request] 19 | 20 | # Declare default permissions as read only. 21 | permissions: read-all 22 | 23 | jobs: 24 | pytest-matrix: 25 | name: Run Pytest on Python ${{matrix.python-version}} 26 | strategy: 27 | matrix: 28 | python-version: ['3.9', '3.10', '3.11', '3.12'] 29 | runs-on: ubuntu-22.04 30 | steps: 31 | - name: Get a local copy of the source repository 32 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 33 | 34 | - name: Set up Python ${{matrix.python-version}} 35 | uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5 36 | with: 37 | python-version: ${{matrix.python-version}} 38 | architecture: 'x64' 39 | 40 | - name: Install requirements 41 | run: pip install -r ./dev_tools/pip-list 42 | 43 | - name: Pytest check 44 | run: pytest 45 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2017 The OpenFermion Developers. 2 | OpenFermion (www.openfermion.org) was developed by: 3 | 4 | Ryan Babbush (Google) 5 | Jarrod McClean (Google) 6 | Kevin J. Sung (University of Michigan) 7 | Ian Kivlichan (Harvard) 8 | 9 | Dave Bacon (Google) 10 | Yudong Cao (Harvard) 11 | Chengyu Dai (University of Michigan) 12 | E. Schuyler Fried (Harvard) 13 | Craig Gidney (Google) 14 | Brendan Gimby (University of Michigan) 15 | Pranav Gokhale (University of Chicago) 16 | Thomas Haener (ETH Zurich) 17 | Tarini Hardikar (Dartmouth) 18 | Vojtech Havlicek (Oxford) 19 | Oscar Higgott (University College London) 20 | Cupjin Huang (University of Michigan) 21 | Josh Izaac (Xanadu) 22 | Zhang Jiang (NASA) 23 | Xinle Liu (Google) 24 | Sam McArdle (Oxford) 25 | Matthew Neeley (Google) 26 | Thomas O'Brien (Leiden University) 27 | Bryan O'Gorman (UC Berkeley, NASA) 28 | Isil Ozfidan (D-Wave Systems) 29 | Max Radin (UC Santa Barbara) 30 | Jhonathan Romero (Harvard) 31 | Nicholas Rubin (Rigetti) 32 | Daniel Sank (Google) 33 | Nicolas Sawaya (Harvard) 34 | Kanav Setia (Dartmouth) 35 | Hannah Sim (Harvard) 36 | Damian Steiger (ETH Zurich) 37 | Mark Steudtner (Leiden University) 38 | Qiming Sun (Caltech) 39 | Wei Sun (Google) 40 | Daochen Wang (River Lane Research) 41 | Chris Winkler (University of Chicago) 42 | Fang Zhang (University of Michigan) 43 | 44 | OpenFermion-PySCF developed as a fork of FermiLib-Plugin-PySCF. 45 | FermiLib-Plugin-PySCF was developed by: 46 | Ryan Babbush (Google) 47 | Jarrod McClean (Google) 48 | Ian Kivlichan (Harvard) 49 | Damian Steiger (ETH Zurich) 50 | Thomas Haener (ETH Zurich) 51 | Dave Bacon (Google) 52 | Qiming Sun (Caltech) 53 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security issues 2 | 3 | The OpenFermion-PySCF developers and community take security bugs in 4 | OpenFermion-PySCF seriously. We appreciate your efforts to responsibly disclose 5 | your findings, and will make every effort to acknowledge your contributions. 6 | 7 | Please **do not** use GitHub issues to report security vulnerabilities; GitHub 8 | issues are public, and doing so could allow someone to exploit the information 9 | before the problem can be addressed. Instead, please use the GitHub ["Report a 10 | Vulnerability"](https://github.com/quantumlib/OpenFermion-PySCF/security/advisories/new) 11 | interface from the _Security_ tab of the OpenFermion-PySCF repository. 12 | 13 | Please report security issues in third-party modules to the person or team 14 | maintaining the module rather than the OpenFermion-PySCF project stewards, 15 | unless you believe that some action needs to be taken with OpenFermion-PySCF in 16 | order to guard against the effects of a security vulnerability in a third-party 17 | module. 18 | 19 | ## Responses to security reports 20 | 21 | The project stewards at Google Quantum AI will send a response indicating the 22 | next steps in handling your report. After the initial reply to your report, the 23 | project stewards will keep you informed of the progress towards a fix and full 24 | announcement, and may ask for additional information or guidance. 25 | 26 | ## Additional points of contact 27 | 28 | Please contact the project stewards at Google Quantum AI via email at 29 | quantum-oss-maintainers@google.com if you have questions or other concerns. If 30 | for any reason you are uncomfortable reaching out to the project stewards, 31 | please email opensource@google.com instead. 32 | -------------------------------------------------------------------------------- /.github/workflows/ossf-scorecard.yaml: -------------------------------------------------------------------------------- 1 | # Summary: workflow for OSSF Scorecard (https://github.com/ossf/scorecard). 2 | # 3 | # Scorecard is an automated tool that assesses a number of important heuristics 4 | # associated with software security and assigns each check a score of 0-10. The 5 | # use of Scorecard is suggested in Google's internal GitHub guidance 6 | # (go/github-docs). 7 | # 8 | # Scorecard creates a report page at the following URL (for a repo ORG/REPO): 9 | # https://scorecard.dev/viewer/?uri=github.com/ORG/REPO 10 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | name: Scorecard code scan 13 | run-name: Run Scorecard code scan 14 | 15 | on: 16 | schedule: 17 | - cron: '19 20 * * 6' 18 | 19 | # Allow manual invocation. 20 | workflow_dispatch: 21 | 22 | # Declare default permissions as read only. 23 | permissions: read-all 24 | 25 | # Cancel any previously-started but still active runs on the same branch. 26 | concurrency: 27 | cancel-in-progress: true 28 | group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}} 29 | 30 | jobs: 31 | scorecard: 32 | name: Perform Scorecard analysis 33 | runs-on: ubuntu-22.04 34 | timeout-minutes: 10 35 | permissions: 36 | # Needed to upload the results to the code-scanning dashboard. 37 | security-events: write 38 | # Needed to publish results and get a badge (see publish_results below). 39 | id-token: write 40 | steps: 41 | - name: Check out a copy of the git repository 42 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 43 | with: 44 | persist-credentials: false 45 | 46 | - name: Run Scorecard analysis 47 | uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 48 | with: 49 | # Save the results 50 | results_file: results.sarif 51 | results_format: sarif 52 | 53 | # Publish results to OpenSSF REST API. 54 | # See https://github.com/ossf/scorecard-action#publishing-results. 55 | publish_results: true 56 | 57 | - name: Upload results to code-scanning dashboard 58 | uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3 59 | with: 60 | sarif_file: results.sarif 61 | -------------------------------------------------------------------------------- /examples/generate_data.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """This is a simple script for generating data.""" 14 | import os 15 | 16 | from openfermion.chem import make_atomic_ring 17 | 18 | from openfermionpyscf import run_pyscf 19 | 20 | 21 | if __name__ == '__main__': 22 | 23 | # Set chemical parameters. 24 | basis = 'sto-3g' 25 | max_electrons = 10 26 | spacing = 0.7414 27 | 28 | # Select calculations. 29 | force_recompute = 1 30 | run_scf = 1 31 | run_mp2 = 1 32 | run_cisd = 1 33 | run_ccsd = 1 34 | run_fci = 1 35 | verbose = 1 36 | 37 | # Generate data. 38 | for n_electrons in range(2, max_electrons + 1): 39 | 40 | # Initialize. 41 | molecule = make_atomic_ring(n_electrons, spacing, basis) 42 | if os.path.exists(molecule.filename + '.hdf5'): 43 | molecule.load() 44 | 45 | # To run or not to run. 46 | if run_scf and not molecule.hf_energy: 47 | run_job = 1 48 | elif run_mp2 and not molecule.mp2_energy: 49 | run_job = 1 50 | elif run_cisd and not molecule.cisd_energy: 51 | run_job = 1 52 | elif run_ccsd and not molecule.ccsd_energy: 53 | run_job = 1 54 | elif run_fci and not molecule.fci_energy: 55 | run_job = 1 56 | else: 57 | run_job = force_recompute 58 | 59 | # Run. 60 | if run_job: 61 | molecule = run_pyscf(molecule, 62 | run_scf=run_scf, 63 | run_mp2=run_mp2, 64 | run_cisd=run_cisd, 65 | run_ccsd=run_ccsd, 66 | run_fci=run_fci, 67 | verbose=verbose) 68 | molecule.save() 69 | -------------------------------------------------------------------------------- /dev_tools/packaging/produce-package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The OpenFermion Developers 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ################################################################################ 18 | # Produces wheels that can be uploaded to the pypi package repository. 19 | # 20 | # First argument must be the output directory. Second argument is an optional 21 | # version specifier. If not set, the version from `_version.py` is used. If set, 22 | # it overwrites `_version.py`. 23 | # 24 | # Usage: 25 | # dev_tools/packaging/produce-package.sh output_dir [version] 26 | ################################################################################ 27 | 28 | PROJECT_NAME=openfermionpyscf 29 | 30 | set -e 31 | 32 | if [ -z "${1}" ]; then 33 | echo -e "\e[31mNo output directory given.\e[0m" 34 | exit 1 35 | fi 36 | out_dir=$(realpath "${1}") 37 | 38 | SPECIFIED_VERSION="${2}" 39 | 40 | # Get the working directory to the repo root. 41 | cd "$( dirname "${BASH_SOURCE[0]}" )" 42 | repo_dir=$(git rev-parse --show-toplevel) 43 | cd ${repo_dir} 44 | 45 | # Make a clean copy of HEAD, without files ignored by git (but potentially kept by setup.py). 46 | if [ ! -z "$(git status --short)" ]; then 47 | echo -e "\e[31mWARNING: You have uncommitted changes. They won't be included in the package.\e[0m" 48 | fi 49 | tmp_git_dir=$(mktemp -d "/tmp/produce-package-git.XXXXXXXXXXXXXXXX") 50 | trap "{ rm -rf ${tmp_git_dir}; }" EXIT 51 | cd "${tmp_git_dir}" 52 | git init --quiet 53 | git fetch ${repo_dir} HEAD --quiet --depth=1 54 | git checkout FETCH_HEAD -b work --quiet 55 | if [ ! -z "${SPECIFIED_VERSION}" ]; then 56 | echo '__version__ = "'"${SPECIFIED_VERSION}"'"' > "${tmp_git_dir}/${PROJECT_NAME}/_version.py" 57 | fi 58 | 59 | # Python wheel. 60 | echo "Producing python package files..." 61 | python3 setup.py -q sdist -d "${out_dir}" 62 | 63 | ls "${out_dir}" 64 | -------------------------------------------------------------------------------- /examples/generate_diatomic.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """This is a simple script for generating data.""" 14 | import os 15 | 16 | from openfermion.chem import MolecularData 17 | 18 | from openfermionpyscf import run_pyscf 19 | 20 | 21 | if __name__ == '__main__': 22 | 23 | # Set chemical parameters. 24 | element_names = ['H', 'H'] 25 | basis = 'sto-3g' 26 | charge = 0 27 | multiplicity = 1 28 | 29 | # Single point at equilibrium for testing 30 | spacings = [0.7414] 31 | 32 | # Add points for a full dissociation curve from 0.1 to 3.0 angstroms 33 | spacings += [0.1 * r for r in range(1, 31)] 34 | 35 | # Set run options 36 | run_scf = 1 37 | run_mp2 = 1 38 | run_cisd = 1 39 | run_ccsd = 1 40 | run_fci = 1 41 | verbose = 1 42 | 43 | # Run Diatomic Curve 44 | for spacing in spacings: 45 | description = "{}".format(spacing) 46 | geometry = [[element_names[0], [0, 0, 0]], 47 | [element_names[1], [0, 0, spacing]]] 48 | molecule = MolecularData(geometry, 49 | basis, 50 | multiplicity, 51 | charge, 52 | description) 53 | 54 | molecule = run_pyscf(molecule, 55 | run_scf=run_scf, 56 | run_mp2=run_mp2, 57 | run_cisd=run_cisd, 58 | run_ccsd=run_ccsd, 59 | run_fci=run_fci, 60 | verbose=verbose) 61 | molecule.save() 62 | 63 | # Run Li H single point 64 | description = "1.45" 65 | geometry = [['Li', [0, 0, 0]], 66 | ['H', [0, 0, 1.45]]] 67 | molecule = MolecularData(geometry, 68 | basis, 69 | multiplicity, 70 | charge, 71 | description) 72 | 73 | molecule = run_pyscf(molecule, 74 | run_scf=run_scf, 75 | run_mp2=run_mp2, 76 | run_cisd=run_cisd, 77 | run_ccsd=run_ccsd, 78 | run_fci=run_fci, 79 | verbose=verbose) 80 | molecule.save() 81 | -------------------------------------------------------------------------------- /dev_tools/packaging/verify-published-package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The OpenFermion Developers 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ################################################################################ 18 | # Downloads and tests openfermionpyscf wheels from the pypi package repository. Uses the 19 | # prod pypi repository unless the --test switch is added. 20 | # 21 | # CAUTION: when targeting the test pypi repository, this script assumes that the 22 | # local version of openfermionpyscf has the same dependencies as the remote one (because the 23 | # dependencies must be installed from the non-test pypi repository). If the 24 | # dependencies disagree, the tests can spuriously fail. 25 | # 26 | # Usage: 27 | # dev_tools/packaging/verify-published-package.sh PACKAGE_VERSION [--test|--prod] 28 | ################################################################################ 29 | 30 | set -e 31 | trap "{ echo -e '\e[31mFAILED\e[0m'; }" ERR 32 | 33 | 34 | PROJECT_NAME=openfermionpyscf 35 | PROJECT_VERSION=$1 36 | PROD_SWITCH=$2 37 | 38 | if [ -z "${PROJECT_VERSION}" ]; then 39 | echo -e "\e[31mFirst argument must be the package version to test.\e[0m" 40 | exit 1 41 | fi 42 | 43 | if [ "${PROD_SWITCH}" = "--test" ]; then 44 | PYPI_REPOSITORY_FLAG="--index-url=https://test.pypi.org/simple/" 45 | PYPI_REPO_NAME="TEST" 46 | elif [ -z "${PROD_SWITCH}" ] || [ "${PROD_SWITCH}" = "--prod" ]; then 47 | PYPI_REPOSITORY_FLAG='' 48 | PYPI_REPO_NAME="PROD" 49 | else 50 | echo -e "\e[31mSecond argument must be empty, '--prod' or '--test'.\e[0m" 51 | exit 1 52 | fi 53 | 54 | # Find the repo root. 55 | cd "$( dirname "${BASH_SOURCE[0]}" )" 56 | REPO_ROOT="$(git rev-parse --show-toplevel)" 57 | 58 | # Temporary workspace. 59 | tmp_dir=$(mktemp -d "/tmp/verify-published-package.XXXXXXXXXXXXXXXX") 60 | cd "${tmp_dir}" 61 | trap "{ rm -rf ${tmp_dir}; }" EXIT 62 | 63 | # Test both the python 2 and python 3 versions. 64 | for PYTHON_VERSION in python2 python3; do 65 | # Prepare. 66 | RUNTIME_DEPS_FILE="${REPO_ROOT}/requirements.txt" 67 | echo -e "\n\e[32m${PYTHON_VERSION}\e[0m" 68 | echo "Working in a fresh virtualenv at ${tmp_dir}/${PYTHON_VERSION}" 69 | virtualenv --quiet "--python=/usr/bin/${PYTHON_VERSION}" "${tmp_dir}/${PYTHON_VERSION}" 70 | 71 | # Install package. 72 | if [ "${PYPI_REPO_NAME}" == "TEST" ]; then 73 | echo "Pre-installing dependencies since they don't all exist in TEST pypi" 74 | "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet -r "${RUNTIME_DEPS_FILE}" 75 | fi 76 | echo Installing "${PROJECT_NAME}==${PROJECT_VERSION} from ${PYPI_REPO_NAME} pypi" 77 | "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PYPI_REPOSITORY_FLAG} "${PROJECT_NAME}==${PROJECT_VERSION}" 78 | 79 | # Run tests. 80 | echo Installing pytest 81 | "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet pytest 82 | PY_VER=$(ls "${tmp_dir}/${PYTHON_VERSION}/lib") 83 | echo Running tests 84 | "${tmp_dir}/${PYTHON_VERSION}/bin/pytest" --quiet --disable-pytest-warnings "${tmp_dir}/${PYTHON_VERSION}/lib/${PY_VER}/site-packages/${PROJECT_NAME}" 85 | done 86 | 87 | echo 88 | echo -e '\e[32mVERIFIED\e[0m' 89 | -------------------------------------------------------------------------------- /openfermionpyscf/tests/_pyscf_molecular_data_test.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """Tests for molecular_data.""" 14 | from __future__ import absolute_import 15 | 16 | import numpy 17 | 18 | from openfermionpyscf import prepare_pyscf_molecule 19 | from openfermionpyscf import PyscfMolecularData 20 | from pyscf import scf, mp, ci, cc, fci 21 | 22 | 23 | geometry = [('H', (0., 0., 0.)), ('H', (0., 0., 0.7414))] 24 | basis = '6-31g' 25 | multiplicity = 1 26 | charge = 0 27 | molecule = PyscfMolecularData(geometry, 28 | basis, 29 | multiplicity, 30 | charge) 31 | 32 | mol = prepare_pyscf_molecule(molecule) 33 | mol.verbose = 0 34 | molecule._pyscf_data['mol'] = mol 35 | molecule._pyscf_data['scf'] = mf = scf.RHF(mol).run() 36 | molecule._pyscf_data['mp2'] = mp.MP2(mf).run() 37 | molecule._pyscf_data['cisd'] = ci.CISD(mf).run() 38 | molecule._pyscf_data['ccsd'] = cc.CCSD(mf).run() 39 | molecule._pyscf_data['fci'] = fci.FCI(mf).run() 40 | 41 | 42 | def test_accessing_rdm(): 43 | mo = molecule.canonical_orbitals 44 | overlap = molecule.overlap_integrals 45 | h1 = molecule.one_body_integrals 46 | h2 = molecule.two_body_integrals 47 | mf = molecule._pyscf_data['scf'] 48 | e_core = mf.energy_nuc() 49 | 50 | rdm1 = molecule.cisd_one_rdm 51 | rdm2 = molecule.cisd_two_rdm 52 | e_ref = molecule._pyscf_data['cisd'].e_tot 53 | e_tot = (numpy.einsum('pq,pq', h1, rdm1) + 54 | numpy.einsum('pqrs,pqrs', h2, rdm2) * .5 + e_core) 55 | numpy.testing.assert_almost_equal(e_tot, e_ref, 9) 56 | 57 | rdm1 = molecule.ccsd_one_rdm 58 | rdm2 = molecule.ccsd_two_rdm 59 | e_ref = molecule._pyscf_data['ccsd'].e_tot 60 | e_tot = (numpy.einsum('pq,pq', h1, rdm1) + 61 | numpy.einsum('pqrs,pqrs', h2, rdm2) * .5 + e_core) 62 | numpy.testing.assert_almost_equal(e_tot, e_ref, 7) 63 | 64 | rdm1 = molecule.fci_one_rdm 65 | rdm2 = molecule.fci_two_rdm 66 | #e_ref = molecule._pyscf_data['fci'].e_tot 67 | e_tot = (numpy.einsum('pq,pq', h1, rdm1) + 68 | numpy.einsum('pqrs,pqrs', h2, rdm2) * .5 + e_core) 69 | numpy.testing.assert_almost_equal(e_tot, -1.1516827321, 9) 70 | 71 | def test_ccsd_amps(): 72 | mo = molecule.canonical_orbitals 73 | h2 = molecule.two_body_integrals 74 | mf = molecule._pyscf_data['scf'] 75 | 76 | ccsd_t1 = molecule.ccsd_single_amps 77 | ccsd_t2 = molecule.ccsd_double_amps 78 | 79 | nmo = mo.shape[1] 80 | g_fock = numpy.zeros((nmo*2,nmo*2)) 81 | g_fock[::2,::2] = g_fock[1::2,1::2] = mo.T.dot(mf.get_fock()).dot(mo) 82 | g_h2 = numpy.zeros((nmo*2,nmo*2,nmo*2,nmo*2)) 83 | g_h2[ ::2, ::2, ::2, ::2] = h2 84 | g_h2[1::2,1::2, ::2, ::2] = h2 85 | g_h2[ ::2, ::2,1::2,1::2] = h2 86 | g_h2[1::2,1::2,1::2,1::2] = h2 87 | g_h2 = g_h2 - g_h2.transpose(0,3,2,1) 88 | 89 | e_corr_ref = molecule._pyscf_data['ccsd'].e_corr 90 | e_corr = (numpy.einsum('ij,ji->', g_fock, ccsd_t1) 91 | + .5 * numpy.einsum('ijkl,jilk->', g_h2, ccsd_t2) 92 | + .5 * numpy.einsum('ijkl,ji,lk->', g_h2, ccsd_t1, ccsd_t1)) 93 | numpy.testing.assert_almost_equal(e_corr_ref, e_corr, 9) 94 | -------------------------------------------------------------------------------- /examples/plotter.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """These functions compare properties of different molecules.""" 14 | import matplotlib.pyplot 15 | import numpy 16 | import warnings 17 | 18 | from openfermion.chem import (make_atom, make_atomic_ring, 19 | MolecularData, periodic_table) 20 | 21 | 22 | def latex_name(molecule): 23 | """Write the name of the molecule in LaTeX. 24 | 25 | Returns: 26 | name: A string giving the name in LaTeX. 27 | """ 28 | # Get sorted atom vector. 29 | atoms = [item[0] for item in molecule.geometry] 30 | atom_charge_info = [(atom, atoms.count(atom)) for atom in set(atoms)] 31 | sorted_info = sorted(atom_charge_info, 32 | key=lambda atom: molecular_data. 33 | _PERIODIC_HASH_TABLE[atom[0]]) 34 | 35 | # Name molecule and return. 36 | name = '{}$_{}$'.format(sorted_info[0][0], sorted_info[0][1]) 37 | for info in sorted_info[1::]: 38 | name += '{}$_{}$'.format(info[0], info[1]) 39 | return name 40 | 41 | 42 | # Run. 43 | if __name__ == '__main__': 44 | 45 | # Set plot parameters. 46 | matplotlib.pyplot.rcParams['text.usetex'] = True 47 | matplotlib.pyplot.rcParams['text.latex.unicode'] = True 48 | matplotlib.pyplot.rc('text', usetex=True) 49 | matplotlib.pyplot.rc('font', family='sans=serif') 50 | marker_size = 6 51 | line_width = 2 52 | axis_size = 12 53 | font_size = 16 54 | x_log = 0 55 | y_log = 0 56 | 57 | # Set chemical series parameters. 58 | max_electrons = 10 59 | spacing = 0.7414 60 | basis = 'sto-3g' 61 | 62 | # Get chemical series. 63 | molecular_series = [] 64 | for n_electrons in range(2, max_electrons + 1): 65 | molecule = make_atomic_ring(n_electrons, spacing, basis) 66 | molecule.load() 67 | molecular_series += [molecule] 68 | 69 | # Get plot data. 70 | x_values = [] 71 | y_values = [] 72 | for molecule in molecular_series: 73 | 74 | # x-axis. 75 | x_label = 'Number of Electrons' 76 | x_values += [molecule.n_electrons] 77 | 78 | # y-axis. 79 | y_label = 'MP2 Energy' 80 | y_values += [molecule.mp2_energy] 81 | 82 | # Print. 83 | print('\n{} for {} = {}.'.format(x_label, molecule.name, x_values[-1])) 84 | print('{} for {} = {}.'.format(y_label, molecule.name, y_values[-1])) 85 | 86 | # Plot. 87 | matplotlib.pyplot.figure(0) 88 | matplotlib.pyplot.plot(x_values, y_values, lw=0, marker='o') 89 | 90 | # Set log scales. 91 | if y_log: 92 | matplotlib.pyplot.yscale('log') 93 | if x_log: 94 | matplotlib.pyplot.xscale('log') 95 | 96 | # Finish making the plot. 97 | matplotlib.pyplot.xticks(size=axis_size) 98 | matplotlib.pyplot.yticks(size=axis_size) 99 | matplotlib.pyplot.xlabel(r'%s' % x_label, fontsize=font_size) 100 | matplotlib.pyplot.ylabel(r'%s' % y_label, fontsize=font_size) 101 | matplotlib.pyplot.show() 102 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of 9 | experience, education, socio-economic status, nationality, personal appearance, 10 | race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or reject 41 | comments, commits, code, wiki edits, issues, and other contributions that are 42 | not aligned to this Code of Conduct, or to ban temporarily or permanently any 43 | contributor for other behaviors that they deem inappropriate, threatening, 44 | offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | This Code of Conduct also applies outside the project spaces when the Project 56 | Stewards have a reasonable belief that an individual's behavior may have a 57 | negative impact on the project or its community. 58 | 59 | ## Conflict Resolution 60 | 61 | We do not believe that all conflict is bad; healthy debate and disagreement 62 | often yield positive results. However, it is never okay to be disrespectful or 63 | to engage in behavior that violates the project’s Code of Conduct. 64 | 65 | If you see someone violating the Code of Conduct, you are encouraged to address 66 | the behavior directly with those involved. Many issues can be resolved quickly 67 | and easily, and this gives people more control over the outcome of their 68 | dispute. If you are unable to resolve the matter for any reason, or if the 69 | behavior is threatening or harassing, report it. We are dedicated to providing 70 | an environment where participants feel welcome and safe. 71 | 72 | Reports should be directed to quantumai-oss-maintainers@googlegroups.com, 73 | the project stewards at Google Quantum AI. They will then work with a committee 74 | consisting of representatives from the Open Source Programs Office and the 75 | Google Open Source Strategy team. If for any reason you are uncomfortable 76 | reaching out to the Project Stewards, please email opensource@google.com. 77 | 78 | We will investigate every complaint, but you may not receive a direct response. 79 | We will use our discretion in determining when and how to follow up on reported 80 | incidents, which may range from not taking action to permanent expulsion from 81 | the project and project-sponsored spaces. We will notify the accused of the 82 | report and provide them an opportunity to discuss it before any action is taken. 83 | The identity of the reporter will be omitted from the details of the report 84 | supplied to the accused. In potentially harmful situations, such as ongoing 85 | harassment or threats to anyone's safety, we may take action without notice. 86 | 87 | ## Attribution 88 | 89 | This Code of Conduct is adapted from the Contributor Covenant, version 1.4, 90 | available at 91 | https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 92 | -------------------------------------------------------------------------------- /dev_tools/packaging/publish-dev-package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The OpenFermion Developers 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ################################################################################ 18 | # Produces and uploads dev-version wheels to a pypi package repository. Uploads 19 | # to the test pypi repository unless the --prod switch is added. 20 | # 21 | # The pypi credentials given to twine are specified via environment variables. 22 | # 23 | # Usage: 24 | # export TEST_TWINE_USERNAME=... 25 | # export TEST_TWINE_PASSWORD=... 26 | # export PROD_TWINE_USERNAME=... 27 | # export PROD_TWINE_PASSWORD=... 28 | # dev_tools/packaging/publish-dev-package.sh EXPECTED_VERSION [--test|--prod] 29 | # 30 | # The uploaded package can be installed with pip, but if it's the test version 31 | # then the requirements must be installed separately first (because they do not 32 | # all exist on test pypi). 33 | # 34 | # Prod installation: 35 | # 36 | # pip install openfermionpyscf==VERSION_YOU_UPLOADED 37 | # 38 | # Test installation: 39 | # 40 | # pip install -r requirements.txt 41 | # pip install --index-url https://test.pypi.org/simple/ openfermionpyscf==VERSION_YOU_UPLOADED 42 | ################################################################################ 43 | 44 | PROJECT_NAME=openfermionpyscf 45 | set -e 46 | trap "{ echo -e '\e[31mFAILED\e[0m'; }" ERR 47 | 48 | EXPECTED_VERSION=$1 49 | PROD_SWITCH=$2 50 | 51 | if [ -z "${EXPECTED_VERSION}" ]; then 52 | echo -e "\e[31mFirst argument must be the expected version.\e[0m" 53 | exit 1 54 | fi 55 | if [[ "${EXPECTED_VERSION}" != *dev* ]]; then 56 | echo -e "\e[31mExpected version must include 'dev'.\e[0m" 57 | exit 1 58 | fi 59 | ACTUAL_VERSION_LINE=$(cat "${PROJECT_NAME}/_version.py" | tail -n 1) 60 | if [ "${ACTUAL_VERSION_LINE}" != '__version__ = "'"${EXPECTED_VERSION}"'"' ]; then 61 | echo -e "\e[31mExpected version (${EXPECTED_VERSION}) didn't match the one in ${PROJECT_NAME}/_version.py (${ACTUAL_VERSION_LINE}).\e[0m" 62 | exit 1 63 | fi 64 | 65 | if [ -z "${PROD_SWITCH}" ] || [ "${PROD_SWITCH}" = "--test" ]; then 66 | PYPI_REPOSITORY_FLAG="--repository-url=https://test.pypi.org/legacy/" 67 | PYPI_REPO_NAME="TEST" 68 | USERNAME="${TEST_TWINE_USERNAME}" 69 | PASSWORD="${TEST_TWINE_PASSWORD}" 70 | if [ -z "${USERNAME}" ]; then 71 | echo -e "\e[31mTEST_TWINE_USERNAME environment variable must be set.\e[0m" 72 | exit 1 73 | fi 74 | if [ -z "${PASSWORD}" ]; then 75 | echo -e "\e[31mTEST_TWINE_PASSWORD environment variable must be set.\e[0m" 76 | exit 1 77 | fi 78 | elif [ "${PROD_SWITCH}" = "--prod" ]; then 79 | PYPI_REPOSITORY_FLAG='' 80 | PYPI_REPO_NAME="PROD" 81 | USERNAME="${PROD_TWINE_USERNAME}" 82 | PASSWORD="${PROD_TWINE_PASSWORD}" 83 | if [ -z "${USERNAME}" ]; then 84 | echo -e "\e[31mPROD_TWINE_USERNAME environment variable must be set.\e[0m" 85 | exit 1 86 | fi 87 | if [ -z "${PASSWORD}" ]; then 88 | echo -e "\e[31mPROD_TWINE_PASSWORD environment variable must be set.\e[0m" 89 | exit 1 90 | fi 91 | else 92 | echo -e "\e[31mSecond argument must be empty, '--test' or '--prod'.\e[0m" 93 | exit 1 94 | fi 95 | 96 | 97 | UPLOAD_VERSION="${EXPECTED_VERSION}$(date "+%Y%m%d%H%M%S")" 98 | echo -e "Producing package with version \e[33m\e[100m${UPLOAD_VERSION}\e[0m to upload to \e[33m\e[100m${PYPI_REPO_NAME}\e[0m pypi repository" 99 | 100 | # Get the working directory to the repo root. 101 | cd "$( dirname "${BASH_SOURCE[0]}" )" 102 | cd "$(git rev-parse --show-toplevel)" 103 | 104 | # Temporary workspace. 105 | tmp_package_dir=$(mktemp -d "/tmp/publish-dev-package_package.XXXXXXXXXXXXXXXX") 106 | trap "{ rm -rf ${tmp_package_dir}; }" EXIT 107 | 108 | # Produce packages. 109 | dev_tools/packaging/produce-package.sh "${tmp_package_dir}" "${UPLOAD_VERSION}" 110 | twine upload --username="${USERNAME}" --password="${PASSWORD}" ${PYPI_REPOSITORY_FLAG} "${tmp_package_dir}/*" 111 | 112 | echo -e "\e[32mUploaded package with version ${UPLOAD_VERSION} to ${PYPI_REPO_NAME} pypi repository\e[0m" 113 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | OpenFermion-PySCF 2 | ================= 3 | 4 | .. image:: https://badge.fury.io/py/openfermionpyscf.svg 5 | :target: https://badge.fury.io/py/openfermionpyscf 6 | 7 | .. image:: https://github.com/quantumlib/OpenFermion-PySCF/workflows/Continuous%20Integration/badge.svg 8 | :target: https://github.com/quantumlib/OpenFermion-PySCF/actions?query=workflow%3A%22Continuous+Integration%22 9 | 10 | 11 | `OpenFermion `__ is an open source library (licensed under Apache 2) for compiling and analyzing quantum algorithms which simulate fermionic systems. 12 | This plugin library allows the electronic structure package `PySCF `__ (licensed under BSD-2-Clause) to interface with OpenFermion. 13 | 14 | Installation 15 | ------------ 16 | 17 | To start using OpenFermion-PySCF, first install `PySCF 18 | `__. 19 | Then, to install the latest versions of OpenFermion and OpenFermion-PySCF (in development mode): 20 | 21 | .. code-block:: bash 22 | 23 | git clone https://github.com/quantumlib/OpenFermion-PySCF 24 | cd OpenFermion-PySCF 25 | python -m pip install -e . 26 | 27 | Alternatively, to install the latest PyPI releases as libraries (in user mode): 28 | 29 | .. code-block:: bash 30 | 31 | python -m pip install --user openfermionpyscf 32 | 33 | Also be sure to take a look at the `ipython notebook demo `__. 34 | 35 | How to contribute 36 | ----------------- 37 | 38 | We'd love to accept your contributions and patches to OpenFermion-PySCF. 39 | There are a few guidelines you need to follow. 40 | Contributions to OpenFermion-PySCF must be accompanied by a Contributor License Agreement. 41 | You (or your employer) retain the copyright to your contribution, 42 | this simply gives us permission to use and redistribute your contributions as part of the project. 43 | Head over to https://cla.developers.google.com/ 44 | to see your current agreements on file or to sign a new one. 45 | 46 | All submissions, including submissions by project members, require review. 47 | We use GitHub pull requests for this purpose. Consult 48 | `GitHub Help `__ for 49 | more information on using pull requests. 50 | Furthermore, please make sure your new code comes with extensive tests! 51 | We use automatic testing to make sure all pull requests pass tests and do not 52 | decrease overall test coverage by too much. Make sure you adhere to our style 53 | guide. Just have a look at our code for clues. We mostly follow 54 | `PEP 8 `_ and use 55 | the corresponding `linter `_ to check for it. 56 | Code should always come with documentation. 57 | 58 | Authors 59 | ------- 60 | 61 | `Ryan Babbush `__ (Google), 62 | `Jarrod McClean `__ (Google), 63 | `Kevin Sung `__ (University of Michigan), 64 | `Ian Kivlichan `__ (Harvard), 65 | `Dave Bacon `__ (Google), 66 | `Yudong Cao `__ (Harvard), 67 | `Chengyu Dai `__ (University of Michigan), 68 | `E. Schuyler Fried `__ (Harvard), 69 | `Craig Gidney `__ (Google), 70 | `Brendan Gimby `__ (University of Michigan), 71 | `Pranav Gokhale `__ (University of Chicago), 72 | `Thomas Häner `__ (ETH Zurich), 73 | `Tarini Hardikar `__ (Dartmouth), 74 | `Vojtĕch Havlíček `__ (Oxford), 75 | `Oscar Higgott `__ (University College London), 76 | `Cupjin Huang `__ (University of Michigan), 77 | `Josh Izaac `__ (Xanadu), 78 | `Zhang Jiang `__ (NASA), 79 | `Xinle Liu `__ (Google), 80 | `Sam McArdle `__ (Oxford), 81 | `Matthew Neeley `__ (Google), 82 | `Thomas O'Brien `__ (Leiden University), 83 | `Bryan O'Gorman `__ (UC Berkeley, NASA), 84 | `Isil Ozfidan `__ (D-Wave Systems), 85 | `Max Radin `__ (UC Santa Barbara), 86 | `Jhonathan Romero `__ (Harvard), 87 | `Nicholas Rubin `__ (Google), 88 | `Daniel Sank `__ (Google), 89 | `Nicolas Sawaya `__ (Harvard), 90 | `Kanav Setia `__ (Dartmouth), 91 | `Hannah Sim `__ (Harvard), 92 | `Damian Steiger `__ (ETH Zurich), 93 | `Mark Steudtner `__ (Leiden University), 94 | `Qiming Sun `__ (Caltech), 95 | `Wei Sun `__ (Google), 96 | `Daochen Wang `__ (River Lane Research), 97 | `Chris Winkler `__ (University of Chicago) and 98 | `Fang Zhang `__ (University of Michigan). 99 | 100 | How to cite 101 | ----------- 102 | When using OpenFermion-PySCF for research projects, please cite: 103 | 104 | Jarrod R. McClean, Kevin J. Sung, Ian D. Kivlichan, Yudong Cao, 105 | Chengyu Dai, E. Schuyler Fried, Craig Gidney, Brendan Gimby, 106 | Pranav Gokhale, Thomas Häner, Tarini Hardikar, Vojtĕch Havlíček, 107 | Oscar Higgott, Cupjin Huang, Josh Izaac, Zhang Jiang, Xinle Liu, 108 | Sam McArdle, Matthew Neeley, Thomas O'Brien, Bryan O'Gorman, Isil Ozfidan, 109 | Maxwell D. Radin, Jhonathan Romero, Nicholas Rubin, Nicolas P. D. Sawaya, 110 | Kanav Setia, Sukin Sim, Damian S. Steiger, Mark Steudtner, Qiming Sun, 111 | Wei Sun, Daochen Wang, Fang Zhang and Ryan Babbush. 112 | *OpenFermion: The Electronic Structure Package for Quantum Computers*. 113 | `arXiv:1710.07629 `__. 2017. 114 | 115 | as well as 116 | 117 | Qiming Sun, Timothy C. Berkelbach, Nick S. Blunt, George H. Booth, Sheng Guo, 118 | Zhendong Li, Junzi Liu, James McClain, Elvira. R. Sayfutyarova, Sandeep Sharma, 119 | Sebastian Wouters and Garnet Kin-Lic Chan. 120 | *The Python-based Simulations of Chemistry Framework (PySCF)*. 121 | `WIREs Compututational Molecular Science `__. 122 | 2017. 123 | 124 | We are happy to include future contributors as authors on later OpenFermion releases. 125 | 126 | Disclaimer 127 | ---------- 128 | Copyright 2017 The OpenFermion Developers. 129 | This is not an official Google product. 130 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We'd love to accept your patches and contributions to this project. We do have 4 | some guidelines to follow, covered in this document, but don't be concerned 5 | about getting everything right the first time! Create a pull request (discussed 6 | below) and we'll nudge you in the right direction. 7 | 8 | ## Before you begin 9 | 10 | ### Sign our Contributor License Agreement 11 | 12 | Contributions to this project must be accompanied by a [Contributor License 13 | Agreement](https://cla.developers.google.com/about) (CLA). You (or your 14 | employer) retain the copyright to your contribution; the CLA simply gives us 15 | permission to use and redistribute your contributions as part of the project. 16 | Please visit https://cla.developers.google.com/ to see your current agreements 17 | on file or to sign a new one. You generally only need to submit a Google CLA 18 | once, so if you've already submitted one (even if it was for a different 19 | project), you probably don't need to do it again. 20 | 21 | > [!WARNING] 22 | > Please note carefully clauses [#5](https://cla.developers.google.com/about/google-corporate#:~:text=You%20represent%20that%20each%20of%20Your%20Contributions%20is%20Your%20original%20creation) 23 | > and [#7](https://cla.developers.google.com/about/google-corporate#:~:text=Should%20You%20wish%20to%20submit%20work%20that%20is%20not%20Your%20original%20creation%2C%20You%20may%20submit%20it%20to%20Google%20separately) 24 | > in the CLA. Any code that you contribute to this project must be **your** 25 | > original creation. Code generated by artificial intelligence tools **does 26 | > not** qualify as your original creation. 27 | 28 | ### Review our community guidelines 29 | 30 | We have a [code of conduct](CODE_OF_CONDUCT.md) to make the project an open and 31 | welcoming community environment. Please make sure to read and abide by the code 32 | of conduct. 33 | 34 | ## Contribution process 35 | 36 | All submissions, including submissions by project members, require review. We 37 | use the tools provided by GitHub for pull requests for this purpose. The 38 | preferred manner for submitting pull requests is to fork the, create a new 39 | branch in this fork to do your work, and when ready, create a pull request from 40 | this branch to the main project repository. The subsections below describe the 41 | process in more detail. 42 | 43 | Pleae make sure to follow the [Google Style 44 | Guides](https://google.github.io/styleguide/) in your code, particularly the 45 | [style guide for Python](https://google.github.io/styleguide/pyguide.html). 46 | 47 | ### Repository forks 48 | 49 | 1. Fork the OpenFermion-PySCF repository (you can use the _Fork_ button in 50 | upper right corner of the [repository 51 | page](https://github.com/quantumlib/OpenFermion-PySCF)). Forking creates a 52 | new GitHub repo at the location 53 | `https://github.com/USERNAME/OpenFermion-PySCF`, where `USERNAME` is your 54 | GitHub user name. 55 | 56 | 1. Clone (using `git clone`) or otherwise download your forked repository to 57 | your local computer, so that you have a local copy where you can do your 58 | development work using your preferred editor and development tools. 59 | 60 | 1. Check out the `main` branch and create a new [git 61 | branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) 62 | from `main`: 63 | 64 | ```shell 65 | git checkout main -b YOUR_BRANCH_NAME 66 | ``` 67 | 68 | where `YOUR_BRANCH_NAME` is the name of your new branch. 69 | 70 | ### Development environment installation 71 | 72 | Please refer to the section _Developer install_ of the [installation 73 | instructions](docs/install.md) for information about how to set up a local copy 74 | of the software for development. 75 | 76 | ### Tests and test coverage 77 | 78 | Existing tests must continue to pass (or be updated) when changes are 79 | introduced, and code should be covered by tests. We use 80 | [pytest](https://docs.pytest.org) to run our tests and 81 | [pytest-cov](https://pytest-cov.readthedocs.io) to compute coverage. We use the 82 | scripts [`./check/pytest`](./check/pytest) and 83 | [`./check/pytest-and-incremental-coverage`](./check/pytest-and-incremental-coverage) 84 | to run these programs with custom configurations for this project. 85 | 86 | We don't require 100% coverage, but any uncovered code must be annotated with `# 87 | pragma: no cover`. To ignore coverage of a single line, place `# pragma: no 88 | cover` at the end of the line. To ignore coverage for an entire block, start the 89 | block with a `# pragma: no cover` comment on its own line. 90 | 91 | ### Lint 92 | 93 | Code should meet common style standards for Python and be free of error-prone 94 | constructs. We use [Pylint](https://www.pylint.org/) to check for code lint, and 95 | the script [`./check/pylint`](./check/pylint) to run it. When Pylint produces a 96 | false positive, it can be silenced with annotations. For example, the annotation 97 | `# pylint: disable=unused-import` would silence a warning about an unused 98 | import. 99 | 100 | ### Type annotations 101 | 102 | Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). 103 | We use [mypy](http://mypy-lang.org/) to check that type annotations are correct, 104 | and the script [`./check/mypy`](./check/mypy) to run it. When type checking 105 | produces a false positive, it can be silenced with annotations such as `# type: 106 | ignore`. 107 | 108 | ### Pull requests and code reviews 109 | 110 | 1. If your local copy has drifted out of sync with the `main` branch of the 111 | main OpenFermion-PySCF repo, you may need to merge the latest changes into 112 | your branch. To do this, first update your local `main` and then merge your 113 | local `main` into your branch: 114 | 115 | ```shell 116 | # Track the upstream repo (if your local repo hasn't): 117 | git remote add upstream https://github.com/quantumlib/OpenFermion-PySCF.git 118 | 119 | # Update your local main. 120 | git fetch upstream 121 | git checkout main 122 | git merge upstream/main 123 | # Merge local main into your branch. 124 | git checkout YOUR_BRANCH_NAME 125 | git merge main 126 | ``` 127 | 128 | If git reports conflicts during one or both of these merge processes, you 129 | may need to [resolve the merge conflicts]( 130 | https://docs.github.com/articles/about-merge-conflicts) before continuing. 131 | 132 | 1. Finally, push your changes to your fork of the OpenFermion-PySCF repo on 133 | GitHub: 134 | 135 | ```shell 136 | git push origin YOUR_BRANCH_NAME 137 | ``` 138 | 139 | 1. Now when you navigate to the OpenFermion-PySCF repository on GitHub 140 | (https://github.com/quantumlib/OpenFermion-PySCF), you should see the option 141 | to create a new [pull 142 | requests](https://help.github.com/articles/about-pull-requests/) from your 143 | forked repository. Alternatively, you can create the pull request by 144 | navigating to the "Pull requests" tab near the top of the page, and 145 | selecting the appropriate branches. 146 | 147 | 1. A reviewer from the OpenFermion-PySCF team will comment on your code and may 148 | ask for changes. You can perform the necessary changes locally, commit them 149 | to your branch as usual, and then push changes to your fork on GitHub 150 | following the same process as above. When you do that, GitHub will update 151 | the code in the pull request automatically. 152 | -------------------------------------------------------------------------------- /openfermionpyscf/_run_pyscf.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """Driver to initialize molecular object from pyscf program.""" 14 | 15 | from __future__ import absolute_import 16 | 17 | from functools import reduce 18 | 19 | import numpy 20 | from pyscf import gto, scf, ao2mo, ci, cc, fci, mp 21 | 22 | from openfermion import MolecularData 23 | from openfermionpyscf import PyscfMolecularData 24 | 25 | 26 | def prepare_pyscf_molecule(molecule): 27 | """ 28 | This function creates and saves a pyscf input file. 29 | 30 | Args: 31 | molecule: An instance of the MolecularData class. 32 | 33 | Returns: 34 | pyscf_molecule: A pyscf molecule instance. 35 | """ 36 | pyscf_molecule = gto.Mole() 37 | pyscf_molecule.atom = molecule.geometry 38 | pyscf_molecule.basis = molecule.basis 39 | pyscf_molecule.spin = molecule.multiplicity - 1 40 | pyscf_molecule.charge = molecule.charge 41 | pyscf_molecule.symmetry = False 42 | pyscf_molecule.build() 43 | 44 | return pyscf_molecule 45 | 46 | 47 | def compute_scf(pyscf_molecule): 48 | """ 49 | Perform a Hartree-Fock calculation. 50 | 51 | Args: 52 | pyscf_molecule: A pyscf molecule instance. 53 | 54 | Returns: 55 | pyscf_scf: A PySCF "SCF" calculation object. 56 | """ 57 | if pyscf_molecule.spin: 58 | pyscf_scf = scf.ROHF(pyscf_molecule) 59 | else: 60 | pyscf_scf = scf.RHF(pyscf_molecule) 61 | return pyscf_scf 62 | 63 | 64 | def compute_integrals(pyscf_molecule, pyscf_scf): 65 | """ 66 | Compute the 1-electron and 2-electron integrals. 67 | 68 | Args: 69 | pyscf_molecule: A pyscf molecule instance. 70 | pyscf_scf: A PySCF "SCF" calculation object. 71 | 72 | Returns: 73 | one_electron_integrals: An N by N array storing h_{pq} 74 | two_electron_integrals: An N by N by N by N array storing h_{pqrs}. 75 | """ 76 | # Get one electrons integrals. 77 | n_orbitals = pyscf_scf.mo_coeff.shape[1] 78 | one_electron_compressed = reduce(numpy.dot, (pyscf_scf.mo_coeff.T, 79 | pyscf_scf.get_hcore(), 80 | pyscf_scf.mo_coeff)) 81 | one_electron_integrals = one_electron_compressed.reshape( 82 | n_orbitals, n_orbitals).astype(float) 83 | 84 | # Get two electron integrals in compressed format. 85 | two_electron_compressed = ao2mo.kernel(pyscf_molecule, 86 | pyscf_scf.mo_coeff) 87 | 88 | two_electron_integrals = ao2mo.restore( 89 | 1, # no permutation symmetry 90 | two_electron_compressed, n_orbitals) 91 | # See PQRS convention in OpenFermion.hamiltonians._molecular_data 92 | # h[p,q,r,s] = (ps|qr) 93 | two_electron_integrals = numpy.asarray( 94 | two_electron_integrals.transpose(0, 2, 3, 1), order='C') 95 | 96 | # Return. 97 | return one_electron_integrals, two_electron_integrals 98 | 99 | 100 | def run_pyscf(molecule, 101 | run_scf=True, 102 | run_mp2=False, 103 | run_cisd=False, 104 | run_ccsd=False, 105 | run_fci=False, 106 | verbose=False): 107 | """ 108 | This function runs a pyscf calculation. 109 | 110 | Args: 111 | molecule: An instance of the MolecularData or PyscfMolecularData class. 112 | run_scf: Optional boolean to run SCF calculation. 113 | run_mp2: Optional boolean to run MP2 calculation. 114 | run_cisd: Optional boolean to run CISD calculation. 115 | run_ccsd: Optional boolean to run CCSD calculation. 116 | run_fci: Optional boolean to FCI calculation. 117 | verbose: Boolean whether to print calculation results to screen. 118 | 119 | Returns: 120 | molecule: The updated PyscfMolecularData object. Note the attributes 121 | of the input molecule are also updated in this function. 122 | """ 123 | # Prepare pyscf molecule. 124 | pyscf_molecule = prepare_pyscf_molecule(molecule) 125 | molecule.n_orbitals = int(pyscf_molecule.nao_nr()) 126 | molecule.n_qubits = 2 * molecule.n_orbitals 127 | molecule.nuclear_repulsion = float(pyscf_molecule.energy_nuc()) 128 | 129 | # Run SCF. 130 | pyscf_scf = compute_scf(pyscf_molecule) 131 | pyscf_scf.verbose = 0 132 | pyscf_scf.run() 133 | molecule.hf_energy = float(pyscf_scf.e_tot) 134 | if verbose: 135 | print('Hartree-Fock energy for {} ({} electrons) is {}.'.format( 136 | molecule.name, molecule.n_electrons, molecule.hf_energy)) 137 | 138 | # Hold pyscf data in molecule. They are required to compute density 139 | # matrices and other quantities. 140 | molecule._pyscf_data = pyscf_data = {} 141 | pyscf_data['mol'] = pyscf_molecule 142 | pyscf_data['scf'] = pyscf_scf 143 | 144 | # Populate fields. 145 | molecule.canonical_orbitals = pyscf_scf.mo_coeff.astype(float) 146 | molecule.orbital_energies = pyscf_scf.mo_energy.astype(float) 147 | 148 | # Get integrals. 149 | one_body_integrals, two_body_integrals = compute_integrals( 150 | pyscf_molecule, pyscf_scf) 151 | molecule.one_body_integrals = one_body_integrals 152 | molecule.two_body_integrals = two_body_integrals 153 | molecule.overlap_integrals = pyscf_scf.get_ovlp() 154 | 155 | # Run MP2. 156 | if run_mp2: 157 | if molecule.multiplicity != 1: 158 | print("WARNING: RO-MP2 is not available in PySCF.") 159 | else: 160 | pyscf_mp2 = mp.MP2(pyscf_scf) 161 | pyscf_mp2.verbose = 0 162 | pyscf_mp2.run() 163 | # molecule.mp2_energy = pyscf_mp2.e_tot # pyscf-1.4.4 or higher 164 | molecule.mp2_energy = pyscf_scf.e_tot + pyscf_mp2.e_corr 165 | pyscf_data['mp2'] = pyscf_mp2 166 | if verbose: 167 | print('MP2 energy for {} ({} electrons) is {}.'.format( 168 | molecule.name, molecule.n_electrons, molecule.mp2_energy)) 169 | 170 | # Run CISD. 171 | if run_cisd: 172 | pyscf_cisd = ci.CISD(pyscf_scf) 173 | pyscf_cisd.verbose = 0 174 | pyscf_cisd.run() 175 | molecule.cisd_energy = pyscf_cisd.e_tot 176 | pyscf_data['cisd'] = pyscf_cisd 177 | if verbose: 178 | print('CISD energy for {} ({} electrons) is {}.'.format( 179 | molecule.name, molecule.n_electrons, molecule.cisd_energy)) 180 | 181 | # Run CCSD. 182 | if run_ccsd: 183 | pyscf_ccsd = cc.CCSD(pyscf_scf) 184 | pyscf_ccsd.verbose = 0 185 | pyscf_ccsd.run() 186 | molecule.ccsd_energy = pyscf_ccsd.e_tot 187 | pyscf_data['ccsd'] = pyscf_ccsd 188 | if verbose: 189 | print('CCSD energy for {} ({} electrons) is {}.'.format( 190 | molecule.name, molecule.n_electrons, molecule.ccsd_energy)) 191 | 192 | # Run FCI. 193 | if run_fci: 194 | pyscf_fci = fci.FCI(pyscf_molecule, pyscf_scf.mo_coeff) 195 | pyscf_fci.verbose = 0 196 | molecule.fci_energy = pyscf_fci.kernel()[0] 197 | pyscf_data['fci'] = pyscf_fci 198 | if verbose: 199 | print('FCI energy for {} ({} electrons) is {}.'.format( 200 | molecule.name, molecule.n_electrons, molecule.fci_energy)) 201 | 202 | # Return updated molecule instance. 203 | pyscf_molecular_data = PyscfMolecularData.__new__(PyscfMolecularData) 204 | pyscf_molecular_data.__dict__.update(molecule.__dict__) 205 | pyscf_molecular_data.save() 206 | return pyscf_molecular_data 207 | 208 | 209 | def generate_molecular_hamiltonian( 210 | geometry, 211 | basis, 212 | multiplicity, 213 | charge=0, 214 | n_active_electrons=None, 215 | n_active_orbitals=None): 216 | """Generate a molecular Hamiltonian with the given properties. 217 | 218 | Args: 219 | geometry: A list of tuples giving the coordinates of each atom. 220 | An example is [('H', (0, 0, 0)), ('H', (0, 0, 0.7414))]. 221 | Distances in angstrom. Use atomic symbols to 222 | specify atoms. 223 | basis: A string giving the basis set. An example is 'cc-pvtz'. 224 | Only optional if loading from file. 225 | multiplicity: An integer giving the spin multiplicity. 226 | charge: An integer giving the charge. 227 | n_active_electrons: An optional integer specifying the number of 228 | electrons desired in the active space. 229 | n_active_orbitals: An optional integer specifying the number of 230 | spatial orbitals desired in the active space. 231 | 232 | Returns: 233 | The Hamiltonian as an InteractionOperator. 234 | """ 235 | 236 | # Run electronic structure calculations 237 | molecule = run_pyscf( 238 | MolecularData(geometry, basis, multiplicity, charge) 239 | ) 240 | 241 | # Freeze core orbitals and truncate to active space 242 | if n_active_electrons is None: 243 | n_core_orbitals = 0 244 | occupied_indices = None 245 | else: 246 | n_core_orbitals = (molecule.n_electrons - n_active_electrons) // 2 247 | occupied_indices = list(range(n_core_orbitals)) 248 | 249 | if n_active_orbitals is None: 250 | active_indices = None 251 | else: 252 | active_indices = list(range(n_core_orbitals, 253 | n_core_orbitals + n_active_orbitals)) 254 | 255 | return molecule.get_molecular_hamiltonian( 256 | occupied_indices=occupied_indices, 257 | active_indices=active_indices) 258 | -------------------------------------------------------------------------------- /openfermionpyscf/_pyscf_molecular_data.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | """Class to use pyscf program to access quantum chemistry data.""" 14 | 15 | import numpy 16 | from functools import reduce 17 | from pyscf import ao2mo 18 | from pyscf import scf 19 | from pyscf.cc.addons import spatial2spin 20 | from openfermion.chem import MolecularData 21 | 22 | 23 | class PyscfMolecularData(MolecularData): 24 | 25 | """A derived class from openfermion.hamiltonians.MolecularData. This class 26 | is created to store the PySCF method objects as well as molecule data from 27 | a fixed basis set at a fixed geometry that is obtained from PySCF 28 | electronic structure packages. This class provides an interface to access 29 | the PySCF Hartree-Fock, MP, CI, Coupled-Cluster methods and their energies, 30 | density matrices and wavefunctions. 31 | 32 | Attributes: 33 | _pyscf_data(dict): To store PySCF method objects temporarily. 34 | """ 35 | def __init__(self, geometry=None, basis=None, multiplicity=None, 36 | charge=0, description="", filename="", data_directory=None): 37 | MolecularData.__init__(self, geometry, basis, multiplicity, 38 | charge, description, filename, data_directory) 39 | self._pyscf_data = {} 40 | 41 | @property 42 | def canonical_orbitals(self): 43 | """Hartree-Fock canonical orbital coefficients (represented on AO 44 | basis). 45 | """ 46 | if self._canonical_orbitals is None: 47 | scf = self._pyscf_data.get('scf', None) 48 | self._canonical_orbitals = scf.mo_coeff 49 | return self._canonical_orbitals 50 | 51 | @property 52 | def overlap_integrals(self): 53 | """Overlap integrals for AO basis.""" 54 | if self._overlap_integrals is None: 55 | scf = self._pyscf_data.get('scf', None) 56 | self._overlap_integrals = scf.get_ovlp() 57 | return self._overlap_integrals 58 | 59 | @property 60 | def one_body_integrals(self): 61 | """A 2D array for one-body Hamiltonian (H_core) in the MO 62 | representation.""" 63 | if self._one_body_integrals is None: 64 | scf = self._pyscf_data.get('scf', None) 65 | mo = self.canonical_orbitals 66 | h_core = scf.get_hcore() 67 | self._one_body_integrals = reduce(numpy.dot, (mo.T, h_core, mo)) 68 | return self._one_body_integrals 69 | 70 | @property 71 | def two_body_integrals(self): 72 | """A 4-dimension array for electron repulsion integrals in the MO 73 | representation. The integrals are computed as 74 | h[p,q,r,s]=\int \phi_p(x)* \phi_q(y)* V_{elec-elec} \phi_r(y) \phi_s(x) dxdy 75 | """ 76 | if self._two_body_integrals is None: 77 | mol = self._pyscf_data.get('mol', None) 78 | mo = self.canonical_orbitals 79 | n_orbitals = mo.shape[1] 80 | 81 | eri = ao2mo.kernel(mol, mo) 82 | eri = ao2mo.restore(1, # no permutation symmetry 83 | eri, n_orbitals) 84 | # See PQRS convention in OpenFermion.hamiltonians.molecular_data 85 | # h[p,q,r,s] = (ps|qr) = pyscf_eri[p,s,q,r] 86 | self._two_body_integrals = numpy.asarray( 87 | eri.transpose(0, 2, 3, 1), order='C') 88 | return self._two_body_integrals 89 | 90 | @property 91 | def cisd_one_rdm(self): 92 | r"""A 2-dimension array for CISD one-particle density matrix in the MO 93 | representation. d[p,q] = < a^\dagger_p a_q > 94 | """ 95 | if self._cisd_one_rdm is None: 96 | cisd = self._pyscf_data.get('cisd', None) 97 | if cisd is None: 98 | return None 99 | 100 | mf = self._pyscf_data.get('scf', None) 101 | if isinstance(mf, scf.uhf.UHF): 102 | raise ValueError('Spin trace for UCISD density matrix.') 103 | 104 | rdm1 = cisd.make_rdm1() 105 | if isinstance(mf, scf.rohf.ROHF): 106 | rdm1 = rdm1[0] + rdm1[1] 107 | 108 | # pyscf one_rdm is computed as dm1[p,q] = 109 | self._cisd_one_rdm = rdm1.T 110 | return self._cisd_one_rdm 111 | 112 | @property 113 | def cisd_two_rdm(self): 114 | r"""A 4-dimension array for CISD two-particle density matrix in the MO 115 | representation. D[p,q,r,s] = < a^\dagger_p a^\dagger_q a_r a_s > 116 | """ 117 | if self._cisd_two_rdm is None: 118 | cisd = self._pyscf_data.get('cisd', None) 119 | if cisd is None: 120 | return None 121 | 122 | mf = self._pyscf_data.get('scf', None) 123 | if isinstance(mf, scf.uhf.UHF): 124 | raise ValueError('Spin trace for UCISD density matrix.') 125 | 126 | rdm2 = cisd.make_rdm2() 127 | if isinstance(mf, scf.rohf.ROHF): 128 | aa, ab, bb = rdm2 129 | rdm2 = aa + bb + ab + ab.transpose(2, 3, 0, 1) 130 | 131 | # pyscf.ci.cisd.make_rdm2 convention 132 | # dm2[p,s,q,r] = . 133 | # the two_body_tensor in openfermion.ops._interaction_rdm.InteractionRDM 134 | # tbt[p,q,r,s] = . 135 | self._cisd_two_rdm = rdm2.transpose(0, 2, 3, 1) 136 | return self._cisd_two_rdm 137 | 138 | @property 139 | def ccsd_one_rdm(self): 140 | r"""A 2-dimension array for CCSD one-particle density matrix in the MO 141 | representation. d[p,q] = < a^\dagger_p a_q > 142 | """ 143 | ccsd = self._pyscf_data.get('ccsd', None) 144 | if ccsd is None: 145 | return None 146 | 147 | mf = self._pyscf_data.get('scf', None) 148 | if isinstance(mf, scf.uhf.UHF): 149 | raise ValueError('Spin trace for UCCSD density matrix.') 150 | 151 | rdm1 = ccsd.make_rdm1() 152 | if isinstance(mf, scf.rohf.ROHF): 153 | rdm1 = rdm1[0] + rdm1[1] 154 | return rdm1.T 155 | 156 | @property 157 | def ccsd_two_rdm(self): 158 | r"""A 4-dimension array for CCSD two-particle density matrix in the MO 159 | representation. D[p,q,r,s] = < a^\dagger_p a^\dagger_q a_r a_s > 160 | """ 161 | ccsd = self._pyscf_data.get('ccsd', None) 162 | if ccsd is None: 163 | return None 164 | 165 | mf = self._pyscf_data.get('scf', None) 166 | if isinstance(mf, scf.uhf.UHF): 167 | raise ValueError('Spin trace for UCCSD density matrix.') 168 | 169 | rdm2 = ccsd.make_rdm2() 170 | if isinstance(mf, scf.rohf.ROHF): 171 | aa, ab, bb = rdm2 172 | rdm2 = aa + bb + ab + ab.transpose(2, 3, 0, 1) 173 | return rdm2.transpose(0, 2, 3, 1) 174 | 175 | @property 176 | def mp2_one_rdm(self): 177 | r"""A 2-dimension array for MP2 one-particle density matrix in the MO 178 | representation. d[p,q] = < a^\dagger_p a_q > 179 | """ 180 | mp2 = self._pyscf_data.get('mp2', None) 181 | if mp2 is None: 182 | return None 183 | 184 | mf = self._pyscf_data.get('scf', None) 185 | if isinstance(mf, scf.uhf.UHF): 186 | raise ValueError('Spin trace for UMP2 density matrix.') 187 | 188 | rdm1 = mp2.make_rdm1() 189 | if isinstance(mf, scf.rohf.ROHF): 190 | rdm1 = rdm1[0] + rdm1[1] 191 | return rdm1.T 192 | 193 | @property 194 | def mp2_two_rdm(self): 195 | r"""A 4-dimension array for MP2 two-particle density matrix in the MO 196 | representation. D[p,q,r,s] = < a^\dagger_p a^\dagger_q a_r a_s > 197 | """ 198 | mp2 = self._pyscf_data.get('mp2', None) 199 | if mp2 is None: 200 | return None 201 | 202 | mf = self._pyscf_data.get('scf', None) 203 | if isinstance(mf, scf.uhf.UHF): 204 | raise ValueError('Spin trace for UMP2 density matrix.') 205 | 206 | rdm2 = mp2.make_rdm2() 207 | if isinstance(mf, scf.rohf.ROHF): 208 | aa, ab, bb = rdm2 209 | rdm2 = aa + bb + ab + ab.transpose(2, 3, 0, 1) 210 | return rdm2.transpose(0, 2, 3, 1) 211 | 212 | @property 213 | def fci_one_rdm(self): 214 | r"""A 2-dimension array for FCI one-particle density matrix in the MO 215 | representation. d[p,q] = < a^\dagger_p a_q > 216 | """ 217 | if self._fci_one_rdm is None: 218 | fci = self._pyscf_data.get('fci', None) 219 | if fci is None: 220 | return None 221 | 222 | mf = self._pyscf_data.get('scf', None) 223 | if isinstance(mf, scf.uhf.UHF): 224 | raise ValueError('Spin trace for UHF-FCI density matrices.') 225 | 226 | norb = self.canonical_orbitals.shape[1] 227 | nelec = self.n_electrons 228 | self._fci_one_rdm = fci.make_rdm1(fci.ci, norb, nelec).T 229 | return self._fci_one_rdm 230 | 231 | @property 232 | def fci_two_rdm(self): 233 | r"""A 4-dimension array for FCI two-particle density matrix in the MO 234 | representation. D[p,q,r,s] = < a^\dagger_p a^\dagger_q a_r a_s > 235 | """ 236 | if self._fci_two_rdm is None: 237 | fci = self._pyscf_data.get('fci', None) 238 | if fci is None: 239 | return None 240 | 241 | mf = self._pyscf_data.get('scf', None) 242 | if isinstance(mf, scf.uhf.UHF): 243 | raise ValueError('Spin trace for UHF-FCI density matrix.') 244 | 245 | norb = self.canonical_orbitals.shape[1] 246 | nelec = self.n_electrons 247 | fci_rdm2 = fci.make_rdm2(fci.ci, norb, nelec) 248 | self._fci_two_rdm = fci_rdm2.transpose(0, 2, 3, 1) 249 | return self._fci_two_rdm 250 | 251 | @property 252 | def ccsd_single_amps(self): 253 | r"""A 2-dimension array t[a,i] for CCSD single excitation amplitudes 254 | where a is virtual index and i is occupied index. 255 | """ 256 | if self._ccsd_single_amps is None: 257 | ccsd = self._pyscf_data.get('ccsd', None) 258 | if ccsd is None: 259 | return None 260 | 261 | t1 = spatial2spin(ccsd.t1) 262 | no, nv = t1.shape 263 | nmo = no + nv 264 | self._ccsd_single_amps = numpy.zeros((nmo, nmo)) 265 | self._ccsd_single_amps[no:,:no] = t1.T 266 | 267 | return self._ccsd_single_amps 268 | 269 | @property 270 | def ccsd_double_amps(self): 271 | r"""A 4-dimension array t[a,i,b,j] for CCSD double excitation amplitudes 272 | where a, b are virtual indices and i, j are occupied indices. 273 | """ 274 | if self._ccsd_double_amps is None: 275 | ccsd = self._pyscf_data.get('ccsd', None) 276 | if ccsd is None: 277 | return None 278 | 279 | t2 = spatial2spin(ccsd.t2) 280 | no, nv = t2.shape[1:3] 281 | nmo = no + nv 282 | self._ccsd_double_amps = numpy.zeros((nmo, nmo, nmo, nmo)) 283 | self._ccsd_double_amps[no:,:no,no:,:no] = .5 * t2.transpose(2,0,3,1) 284 | 285 | return self._ccsd_double_amps 286 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /examples/openfermionpyscf_demo.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Running PySCF to populate the OpenFermion MolecularData class\n", 8 | "\n", 9 | "The module run_pyscf.py provides a user-friendly way of running PySCF calculations in OpenFermion. The basic idea is that once one generates a MolecularData instance, one can then call PySCF with a specification of certain options (for instance, how much memory to use and what calculations to do) in order to compute things about the molecule, update the MolecularData object, and save results of the calculation. The most common calculations users will want in OpenFermion would probably be self-consistent field (aka Hartree-Fock calculations). Our code uses these \"SCF\" calculations compute orbitals, integrals, Hartree-Fock energy, and more. Other common calculations are CISD and FCI calculations which also compute the 1-RDM and 2-RDM associated with their answers, CCSD calculations which also compute the CCSD amplitudes (useful for UCC) and MP2 calculations which can also be used to UCCSD initial guesses. Note that the \"delete_input\" and \"delete_output\" options indicate whether to save automatically generated pyscf input files or not. To use this plugin, you will need to personally download PySCF.\n", 10 | "\n", 11 | "Warnings: electronic structure calculations are finicky. They sometimes fail for surprising reasons. See the PySCF documentation for more information or consult and electronic structure theory expert." 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 2, 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "\n", 24 | "At bond length of 0.275 angstrom, molecular hydrogen has:\n", 25 | "Hartree-Fock energy of -0.46576369202201073 Hartree.\n", 26 | "MP2 energy of -0.47148376317105634 Hartree.\n", 27 | "FCI energy of -0.4733700032133248 Hartree.\n", 28 | "Nuclear repulsion energy between protons is 1.924280766981818 Hartree.\n", 29 | "Spatial orbital 0 has energy of -0.8173400009356641 Hartree.\n", 30 | "Spatial orbital 1 has energy of 1.4209358488233526 Hartree.\n", 31 | "\n", 32 | "At bond length of 0.35 angstrom, molecular hydrogen has:\n", 33 | "Hartree-Fock energy of -0.7804549020715255 Hartree.\n", 34 | "MP2 energy of -0.7869330192714304 Hartree.\n", 35 | "FCI energy of -0.7892693924044141 Hartree.\n", 36 | "Nuclear repulsion energy between protons is 1.5119348883428574 Hartree.\n", 37 | "Spatial orbital 0 has energy of -0.7738122191065239 Hartree.\n", 38 | "Spatial orbital 1 has energy of 1.2661364723625192 Hartree.\n", 39 | "\n", 40 | "At bond length of 0.425 angstrom, molecular hydrogen has:\n", 41 | "Hartree-Fock energy of -0.9500662941995572 Hartree.\n", 42 | "MP2 energy of -0.9574677535632835 Hartree.\n", 43 | "FCI energy of -0.9603937574322665 Hartree.\n", 44 | "Nuclear repulsion energy between protons is 1.2451228492235296 Hartree.\n", 45 | "Spatial orbital 0 has energy of -0.7312247424842614 Hartree.\n", 46 | "Spatial orbital 1 has energy of 1.1202060156042737 Hartree.\n", 47 | "\n", 48 | "At bond length of 0.5 angstrom, molecular hydrogen has:\n", 49 | "Hartree-Fock energy of -1.042996274540095 Hartree.\n", 50 | "MP2 energy of -1.0514860696249677 Hartree.\n", 51 | "FCI energy of -1.0551597944706257 Hartree.\n", 52 | "Nuclear repulsion energy between protons is 1.05835442184 Hartree.\n", 53 | "Spatial orbital 0 has energy of -0.6908223286619279 Hartree.\n", 54 | "Spatial orbital 1 has energy of 0.9886736730022132 Hartree.\n", 55 | "\n", 56 | "At bond length of 0.575 angstrom, molecular hydrogen has:\n", 57 | "Hartree-Fock energy of -1.091570496777186 Hartree.\n", 58 | "MP2 energy of -1.1013170752841768 Hartree.\n", 59 | "FCI energy of -1.105918053253995 Hartree.\n", 60 | "Nuclear repulsion energy between protons is 0.9203081929043481 Hartree.\n", 61 | "Spatial orbital 0 has energy of -0.6529368383208868 Hartree.\n", 62 | "Spatial orbital 1 has energy of 0.8731057514430565 Hartree.\n", 63 | "\n", 64 | "At bond length of 0.6499999999999999 angstrom, molecular hydrogen has:\n", 65 | "Hartree-Fock energy of -1.1129965456691684 Hartree.\n", 66 | "MP2 energy of -1.1241742963416466 Hartree.\n", 67 | "FCI energy of -1.1299047843229135 Hartree.\n", 68 | "Nuclear repulsion energy between protons is 0.8141187860307694 Hartree.\n", 69 | "Spatial orbital 0 has energy of -0.6176054632350665 Hartree.\n", 70 | "Spatial orbital 1 has energy of 0.7730229954389312 Hartree.\n", 71 | "\n", 72 | "At bond length of 0.7250000000000001 angstrom, molecular hydrogen has:\n", 73 | "Hartree-Fock energy of -1.1173432691225824 Hartree.\n", 74 | "MP2 energy of -1.1301354011287876 Hartree.\n", 75 | "FCI energy of -1.1372213770723039 Hartree.\n", 76 | "Nuclear repulsion energy between protons is 0.7298996012689655 Hartree.\n", 77 | "Spatial orbital 0 has energy of -0.584812015544237 Hartree.\n", 78 | "Spatial orbital 1 has energy of 0.6868770894710645 Hartree.\n", 79 | "\n", 80 | "At bond length of 0.8 angstrom, molecular hydrogen has:\n", 81 | "Hartree-Fock energy of -1.1108503974765953 Hartree.\n", 82 | "MP2 energy of -1.1254535339931437 Hartree.\n", 83 | "FCI energy of -1.1341476666770964 Hartree.\n", 84 | "Nuclear repulsion energy between protons is 0.66147151365 Hartree.\n", 85 | "Spatial orbital 0 has energy of -0.5544958811314894 Hartree.\n", 86 | "Spatial orbital 1 has energy of 0.6126180867352472 Hartree.\n", 87 | "\n", 88 | "At bond length of 0.875 angstrom, molecular hydrogen has:\n", 89 | "Hartree-Fock energy of -1.0974543197010043 Hartree.\n", 90 | "MP2 energy of -1.1140843631590112 Hartree.\n", 91 | "FCI energy of -1.1246717535661337 Hartree.\n", 92 | "Nuclear repulsion energy between protons is 0.604773955337143 Hartree.\n", 93 | "Spatial orbital 0 has energy of -0.526513679939084 Hartree.\n", 94 | "Spatial orbital 1 has energy of 0.5481329834197314 Hartree.\n", 95 | "\n", 96 | "At bond length of 0.95 angstrom, molecular hydrogen has:\n", 97 | "Hartree-Fock energy of -1.079636928210372 Hartree.\n", 98 | "MP2 energy of -1.098534484440576 Hartree.\n", 99 | "FCI energy of -1.1113394177361502 Hartree.\n", 100 | "Nuclear repulsion energy between protons is 0.5570286430736843 Hartree.\n", 101 | "Spatial orbital 0 has energy of -0.5006430534081516 Hartree.\n", 102 | "Spatial orbital 1 has energy of 0.4915605101549557 Hartree.\n", 103 | "\n", 104 | "At bond length of 1.025 angstrom, molecular hydrogen has:\n", 105 | "Hartree-Fock energy of -1.0589807101327922 Hartree.\n", 106 | "MP2 energy of -1.0804144798106843 Hartree.\n", 107 | "FCI energy of -1.095804876013464 Hartree.\n", 108 | "Nuclear repulsion energy between protons is 0.5162704496780488 Hartree.\n", 109 | "Spatial orbital 0 has energy of -0.4766262716426409 Hartree.\n", 110 | "Spatial orbital 1 has energy of 0.441437629682608 Hartree.\n", 111 | "\n", 112 | "At bond length of 1.0999999999999999 angstrom, molecular hydrogen has:\n", 113 | "Hartree-Fock energy of -1.03653887502918 Hartree.\n", 114 | "MP2 energy of -1.060806453195768 Hartree.\n", 115 | "FCI energy of -1.0791929449690745 Hartree.\n", 116 | "Nuclear repulsion energy between protons is 0.4810701917454546 Hartree.\n", 117 | "Spatial orbital 0 has energy of -0.4542186941186985 Hartree.\n", 118 | "Spatial orbital 1 has energy of 0.39669591114496916 Hartree.\n", 119 | "\n", 120 | "At bond length of 1.175 angstrom, molecular hydrogen has:\n", 121 | "Hartree-Fock energy of -1.013060997725848 Hartree.\n", 122 | "MP2 energy of -1.0404875302394085 Hartree.\n", 123 | "FCI energy of -1.0623154166831814 Hartree.\n", 124 | "Nuclear repulsion energy between protons is 0.4503635837617021 Hartree.\n", 125 | "Spatial orbital 0 has energy of -0.4332180175211452 Hartree.\n", 126 | "Spatial orbital 1 has energy of 0.3565744529574856 Hartree.\n", 127 | "\n", 128 | "At bond length of 1.25 angstrom, molecular hydrogen has:\n", 129 | "Hartree-Fock energy of -0.9891138140908918 Hartree.\n", 130 | "MP2 energy of -1.0200494156409707 Hartree.\n", 131 | "FCI energy of -1.0457831445498016 Hartree.\n", 132 | "Nuclear repulsion energy between protons is 0.42334176873600005 Hartree.\n", 133 | "Spatial orbital 0 has energy of -0.413471036648982 Hartree.\n", 134 | "Spatial orbital 1 has energy of 0.3205155543720933 Hartree.\n", 135 | "\n", 136 | "At bond length of 1.325 angstrom, molecular hydrogen has:\n", 137 | "Hartree-Fock energy of -0.9651389795857086 Hartree.\n", 138 | "MP2 energy of -0.9999557388078738 Hartree.\n", 139 | "FCI energy of -1.0300566111312586 Hartree.\n", 140 | "Nuclear repulsion energy between protons is 0.399379027109434 Hartree.\n", 141 | "Spatial orbital 0 has energy of -0.3948663846359507 Hartree.\n", 142 | "Spatial orbital 1 has energy of 0.2880813977524425 Hartree.\n", 143 | "\n", 144 | "At bond length of 1.4 angstrom, molecular hydrogen has:\n", 145 | "Hartree-Fock energy of -0.9414806547077978 Hartree.\n", 146 | "MP2 energy of -0.980569709565992 Hartree.\n", 147 | "FCI energy of -1.0154682492882448 Hartree.\n", 148 | "Nuclear repulsion energy between protons is 0.37798372208571435 Hartree.\n", 149 | "Spatial orbital 0 has energy of -0.37732282536945516 Hartree.\n", 150 | "Spatial orbital 1 has energy of 0.2589019745865794 Hartree.\n", 151 | "\n", 152 | "At bond length of 1.4749999999999999 angstrom, molecular hydrogen has:\n", 153 | "Hartree-Fock energy of -0.9184020557161309 Hartree.\n", 154 | "MP2 energy of -0.9621708709671556 Hartree.\n", 155 | "FCI energy of -1.0022359731038093 Hartree.\n", 156 | "Nuclear repulsion energy between protons is 0.3587642107932204 Hartree.\n", 157 | "Spatial orbital 0 has energy of -0.3607788085045664 Hartree.\n", 158 | "Spatial orbital 1 has energy of 0.2326486343232035 Hartree.\n", 159 | "\n", 160 | "At bond length of 1.5499999999999998 angstrom, molecular hydrogen has:\n", 161 | "Hartree-Fock energy of -0.8960989583249407 Hartree.\n", 162 | "MP2 energy of -0.9449687091655203 Hartree.\n", 163 | "FCI energy of -0.9904763409366254 Hartree.\n", 164 | "Nuclear repulsion energy between protons is 0.34140465220645166 Hartree.\n", 165 | "Spatial orbital 0 has energy of -0.34518506564892704 Hartree.\n", 166 | "Spatial orbital 1 has energy of 0.20902323714127763 Hartree.\n", 167 | "\n", 168 | "At bond length of 1.625 angstrom, molecular hydrogen has:\n", 169 | "Hartree-Fock energy of -0.8747120200718277 Hartree.\n", 170 | "MP2 energy of -0.9291149046731828 Hartree.\n", 171 | "FCI energy of -0.9802196397740324 Hartree.\n", 172 | "Nuclear repulsion energy between protons is 0.3256475144123077 Hartree.\n", 173 | "Spatial orbital 0 has energy of -0.3304998751988645 Hartree.\n", 174 | "Spatial orbital 1 has energy of 0.18775460843350983 Hartree.\n", 175 | "\n", 176 | "At bond length of 1.7 angstrom, molecular hydrogen has:\n", 177 | "Hartree-Fock energy of -0.8543376269512916 Hartree.\n", 178 | "MP2 energy of -0.9147139586114335 Hartree.\n", 179 | "FCI energy of -0.9714266884583406 Hartree.\n", 180 | "Nuclear repulsion energy between protons is 0.3112807123058824 Hartree.\n", 181 | "Spatial orbital 0 has energy of -0.3166860454376414 Hartree.\n", 182 | "Spatial orbital 1 has energy of 0.1685973225429923 Hartree.\n", 183 | "\n", 184 | "At bond length of 1.775 angstrom, molecular hydrogen has:\n", 185 | "Hartree-Fock energy of -0.8350368194547981 Hartree.\n", 186 | "MP2 energy of -0.9018318336255917 Hartree.\n", 187 | "FCI energy of -0.9640064020312284 Hartree.\n", 188 | "Nuclear repulsion energy between protons is 0.2981280061521127 Hartree.\n", 189 | "Spatial orbital 0 has energy of -0.30370886199958386 Hartree.\n", 190 | "Spatial orbital 1 has energy of 0.15133057693444824 Hartree.\n" 191 | ] 192 | }, 193 | { 194 | "name": "stdout", 195 | "output_type": "stream", 196 | "text": [ 197 | "\n", 198 | "At bond length of 1.8499999999999999 angstrom, molecular hydrogen has:\n", 199 | "Hartree-Fock energy of -0.8168422922508727 Hartree.\n", 200 | "MP2 energy of -0.8905026988722495 Hartree.\n", 201 | "FCI energy of -0.9578329678685789 Hartree.\n", 202 | "Nuclear repulsion energy between protons is 0.28604173563243246 Hartree.\n", 203 | "Spatial orbital 0 has energy of -0.29153460879374643 Hartree.\n", 204 | "Spatial orbital 1 has energy of 0.13575653449662808 Hartree.\n", 205 | "\n", 206 | "At bond length of 1.9249999999999998 angstrom, molecular hydrogen has:\n", 207 | "Hartree-Fock energy of -0.7997638281473747 Hartree.\n", 208 | "MP2 energy of -0.8807342139894813 Hartree.\n", 209 | "FCI energy of -0.9527614857390079 Hartree.\n", 210 | "Nuclear repulsion energy between protons is 0.27489725242597407 Hartree.\n", 211 | "Spatial orbital 0 has energy of -0.28012953152597103 Hartree.\n", 212 | "Spatial orbital 1 has energy of 0.12169823435424161 Hartree.\n", 213 | "\n", 214 | "At bond length of 1.9999999999999998 angstrom, molecular hydrogen has:\n", 215 | "Hartree-Fock energy of -0.7837926542773529 Hartree.\n", 216 | "MP2 energy of -0.8725118764674618 Hartree.\n", 217 | "FCI energy of -0.9486411121761856 Hartree.\n", 218 | "Nuclear repulsion energy between protons is 0.26458860546000007 Hartree.\n", 219 | "Spatial orbital 0 has energy of -0.26945922365552716 Hartree.\n", 220 | "Spatial orbital 1 has energy of 0.1089973695491799 Hartree.\n", 221 | "\n", 222 | "At bond length of 2.075 angstrom, molecular hydrogen has:\n", 223 | "Hartree-Fock energy of -0.7689051449297484 Hartree.\n", 224 | "MP2 energy of -0.8658028521389788 Hartree.\n", 225 | "FCI energy of -0.9453251248342422 Hartree.\n", 226 | "Nuclear repulsion energy between protons is 0.25502516188915664 Hartree.\n", 227 | "Spatial orbital 0 has energy of -0.2594884201231308 Hartree.\n", 228 | "Spatial orbital 1 has energy of 0.09751218760149999 Hartree.\n", 229 | "\n", 230 | "At bond length of 2.15 angstrom, molecular hydrogen has:\n", 231 | "Hartree-Fock energy of -0.7550661408488423 Hartree.\n", 232 | "MP2 energy of -0.8605595209374232 Hartree.\n", 233 | "FCI energy of -0.9426777856962735 Hartree.\n", 234 | "Nuclear repulsion energy between protons is 0.24612893531162794 Hartree.\n", 235 | "Spatial orbital 0 has energy of -0.2501811430599045 Hartree.\n", 236 | "Spatial orbital 1 has energy of 0.08711565426939805 Hartree.\n", 237 | "\n", 238 | "At bond length of 2.225 angstrom, molecular hydrogen has:\n", 239 | "Hartree-Fock energy of -0.7422319931586394 Hartree.\n", 240 | "MP2 energy of -0.8567227916776577 Hartree.\n", 241 | "FCI energy of -0.9405782941246521 Hartree.\n", 242 | "Nuclear repulsion energy between protons is 0.23783245434606745 Hartree.\n", 243 | "Spatial orbital 0 has energy of -0.24150109976938902 Hartree.\n", 244 | "Spatial orbital 1 has energy of 0.07769391261659239 Hartree.\n", 245 | "\n", 246 | "At bond length of 2.3000000000000003 angstrom, molecular hydrogen has:\n", 247 | "Hartree-Fock energy of -0.7303533213548863 Hartree.\n", 248 | "MP2 energy of -0.854225123200837 Hartree.\n", 249 | "FCI energy of -0.9389223859872742 Hartree.\n", 250 | "Nuclear repulsion energy between protons is 0.23007704822608696 Hartree.\n", 251 | "Spatial orbital 0 has energy of -0.23341221004999116 Hartree.\n", 252 | "Spatial orbital 1 has energy of 0.06914499850359593 Hartree.\n", 253 | "\n", 254 | "At bond length of 2.375 angstrom, molecular hydrogen has:\n", 255 | "Hartree-Fock energy of -0.7193774167204108 Hartree.\n", 256 | "MP2 energy of -0.8529931494831721 Hartree.\n", 257 | "FCI energy of -0.9376222324118668 Hartree.\n", 258 | "Nuclear repulsion energy between protons is 0.22281145722947368 Hartree.\n", 259 | "Spatial orbital 0 has energy of -0.2258791437571641 Hartree.\n", 260 | "Spatial orbital 1 has energy of 0.06137774272201321 Hartree.\n", 261 | "\n", 262 | "At bond length of 2.45 angstrom, molecular hydrogen has:\n", 263 | "Hartree-Fock energy of -0.7092502192393472 Hartree.\n", 264 | "MP2 energy of -0.8529498300639605 Hartree.\n", 265 | "FCI energy of -0.9366052564161927 Hartree.\n", 266 | "Nuclear repulsion energy between protons is 0.21599069833469386 Hartree.\n", 267 | "Spatial orbital 0 has energy of -0.21886777545208091 Hartree.\n", 268 | "Spatial orbital 1 has energy of 0.05431078984593042 Hartree.\n", 269 | "\n", 270 | "At bond length of 2.525 angstrom, molecular hydrogen has:\n", 271 | "Hartree-Fock energy of -0.6999178290647486 Hartree.\n", 272 | "MP2 energy of -0.854016106823255 Hartree.\n", 273 | "FCI energy of -0.9358123741836938 Hartree.\n", 274 | "Nuclear repulsion energy between protons is 0.20957513303762376 Hartree.\n", 275 | "Spatial orbital 0 has energy of -0.2123455007449538 Hartree.\n", 276 | "Spatial orbital 1 has energy of 0.047871681518727865 Hartree.\n", 277 | "\n", 278 | "At bond length of 2.6 angstrom, molecular hydrogen has:\n", 279 | "Hartree-Fock energy of -0.6913275611973775 Hartree.\n", 280 | "MP2 energy of -0.856112114321373 Hartree.\n", 281 | "FCI energy of -0.9351960308474738 Hartree.\n", 282 | "Nuclear repulsion energy between protons is 0.20352969650769231 Hartree.\n", 283 | "Spatial orbital 0 has energy of -0.20628139769957943 Hartree.\n", 284 | "Spatial orbital 1 has energy of 0.04199597557190842 Hartree.\n", 285 | "\n", 286 | "At bond length of 2.6750000000000003 angstrom, molecular hydrogen has:\n", 287 | "Hartree-Fock energy of -0.6834285962970218 Hartree.\n", 288 | "MP2 energy of -0.8591580411790538 Hartree.\n", 289 | "FCI energy of -0.9347182719512951 Hartree.\n", 290 | "Nuclear repulsion energy between protons is 0.19782325641869158 Hartree.\n", 291 | "Spatial orbital 0 has energy of -0.2006462482136592 Hartree.\n", 292 | "Spatial orbital 1 has energy of 0.03662639378636844 Hartree.\n", 293 | "\n", 294 | "At bond length of 2.75 angstrom, molecular hydrogen has:\n", 295 | "Hartree-Fock energy of -0.6761723104626474 Hartree.\n", 296 | "MP2 energy of -0.863074762873896 Hartree.\n", 297 | "FCI energy of -0.9343489877473077 Hartree.\n", 298 | "Nuclear repulsion energy between protons is 0.19242807669818182 Hartree.\n", 299 | "Spatial orbital 0 has energy of -0.1954124543278043 Hartree.\n", 300 | "Spatial orbital 1 has energy of 0.03171200588285147 Hartree.\n", 301 | "\n", 302 | "At bond length of 2.825 angstrom, molecular hydrogen has:\n", 303 | "Hartree-Fock energy of -0.6695123786141586 Hartree.\n", 304 | "MP2 energy of -0.8677843610573939 Hartree.\n", 305 | "FCI energy of -0.9340643923493084 Hartree.\n", 306 | "Nuclear repulsion energy between protons is 0.18731936669734514 Hartree.\n", 307 | "Spatial orbital 0 has energy of -0.19055389238090079 Hartree.\n", 308 | "Spatial orbital 1 has energy of 0.027207464394279644 Hartree.\n", 309 | "\n", 310 | "At bond length of 2.9 angstrom, molecular hydrogen has:\n", 311 | "Hartree-Fock energy of -0.6634047415990398 Hartree.\n", 312 | "MP2 energy of -0.8732106178680202 Hartree.\n", 313 | "FCI energy of -0.9338457507791562 Hartree.\n", 314 | "Nuclear repulsion energy between protons is 0.1824749003172414 Hartree.\n", 315 | "Spatial orbital 0 has energy of -0.1860457459326097 Hartree.\n", 316 | "Spatial orbital 1 has energy of 0.023072305548767352 Hartree.\n", 317 | "\n", 318 | "At bond length of 2.975 angstrom, molecular hydrogen has:\n", 319 | "Hartree-Fock energy of -0.6578075113036511 Hartree.\n", 320 | "MP2 energy of -0.8792795361303933 Hartree.\n", 321 | "FCI energy of -0.9336783385776661 Hartree.\n", 322 | "Nuclear repulsion energy between protons is 0.1778746927462185 Hartree.\n", 323 | "Spatial orbital 0 has energy of -0.18186434985983013 Hartree.\n", 324 | "Spatial orbital 1 has energy of 0.01927032735081361 Hartree.\n", 325 | "\n", 326 | "At bond length of 3.0500000000000003 angstrom, molecular hydrogen has:\n", 327 | "Hartree-Fock energy of -0.6526808667256654 Hartree.\n", 328 | "MP2 energy of -0.8859198981644987 Hartree.\n", 329 | "FCI energy of -0.9335506049476079 Hartree.\n", 330 | "Nuclear repulsion energy between protons is 0.1735007248918033 Hartree.\n", 331 | "Spatial orbital 0 has energy of -0.1779870665965449 Hartree.\n", 332 | "Spatial orbital 1 has energy of 0.015769050013449082 Hartree.\n", 333 | "\n", 334 | "At bond length of 3.125 angstrom, molecular hydrogen has:\n", 335 | "Hartree-Fock energy of -0.6479869722718786 Hartree.\n", 336 | "MP2 energy of -0.8930638450783953 Hartree.\n", 337 | "FCI energy of -0.9334535061756323 Hartree.\n", 338 | "Nuclear repulsion energy between protons is 0.16933670749440002 Hartree.\n", 339 | "Spatial orbital 0 has energy of -0.1743922040730168 Hartree.\n", 340 | "Spatial orbital 1 has energy of 0.012539257682532279 Hartree.\n", 341 | "\n", 342 | "At bond length of 3.2 angstrom, molecular hydrogen has:\n", 343 | "Hartree-Fock energy of -0.643689931022628 Hartree.\n", 344 | "MP2 energy of -0.9006474392135533 Hartree.\n", 345 | "FCI energy of -0.9333799773488841 Hartree.\n", 346 | "Nuclear repulsion energy between protons is 0.1653678784125 Hartree.\n", 347 | "Spatial orbital 0 has energy of -0.17105897546185678 Hartree.\n", 348 | "Spatial orbital 1 has energy of 0.00955461527119033 Hartree.\n" 349 | ] 350 | }, 351 | { 352 | "data": { 353 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEGCAYAAAB7DNKzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA7DUlEQVR4nO3deXxU9fX4/9fJvpCVhCWsEkFURMFIFasoaj+2LmhVCtqqn2rR9qN0s62ttbX2Z6u11W8tVYtL1VatuGNdAXdRFgUisgdkDUsgK9kz5/fHvYEhzEwGksmdSc7z8ZhH7jZzzyQwZ+77/b7nLaqKMcYYE0yc1wEYY4yJbpYojDHGhGSJwhhjTEiW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ps4314Uhnr4KGOrXPzA1jFO+Cdzo184/pp3jFwETRCRHnFLQl/jtq8aZtjOSWpNCmThzNYTTEf4RMBnAHZV1nLucB8Sp6vPAr3GmhoXQ72MhzvvPczu2p+Jc6ZkewLK98VKq7K8QKsBVqtoiIi8Cp+DMN6447eTb3WRyEFWtF5FpwKsiUouTaNr74P498P+AYhGJAzYA5wc7WFW3isgfcD4w97C/XwWc5p2HRGQ64X2AHzJVrRCRh4DlwHacxNWe+3Eql65w4/0CJ+YBwD/d9w3OiDNw+loeFJE6nN+///lLReRmnPkUBHhVVV/u2LsyscKqxxoTJhHppao17hXFizgl5F/0Oq5g3G/+iW4iLQTmAkepM5e7MWGzKwpjwnebiJyN0wz0FlE+BSeQBrwjzoxxAvzAkoQ5HHZFYYwxJiTrzDbGGBOSJQpjjDEhWaIwxhgTkiUKY4wxIVmiMMYYE9L/DyjgliTuiFbMAAAAAElFTkSuQmCC\n", 354 | "text/plain": [ 355 | "
" 356 | ] 357 | }, 358 | "metadata": { 359 | "needs_background": "light" 360 | }, 361 | "output_type": "display_data" 362 | } 363 | ], 364 | "source": [ 365 | "from openfermion.chem import MolecularData\n", 366 | "from openfermionpyscf import run_pyscf\n", 367 | "\n", 368 | "# Set molecule parameters.\n", 369 | "basis = 'sto-3g'\n", 370 | "multiplicity = 1\n", 371 | "n_points = 40\n", 372 | "bond_length_interval = 3.0 / n_points\n", 373 | "\n", 374 | "# Set calculation parameters.\n", 375 | "run_scf = 1\n", 376 | "run_mp2 = 1\n", 377 | "run_cisd = 0\n", 378 | "run_ccsd = 0\n", 379 | "run_fci = 1\n", 380 | "delete_input = True\n", 381 | "delete_output = True\n", 382 | "\n", 383 | "# Generate molecule at different bond lengths.\n", 384 | "hf_energies = []\n", 385 | "fci_energies = []\n", 386 | "bond_lengths = []\n", 387 | "for point in range(1, n_points + 1):\n", 388 | " bond_length = bond_length_interval * float(point) + 0.2\n", 389 | " bond_lengths += [bond_length]\n", 390 | " geometry = [('H', (0., 0., 0.)), ('H', (0., 0., bond_length))]\n", 391 | " molecule = MolecularData(\n", 392 | " geometry, basis, multiplicity,\n", 393 | " description=str(round(bond_length, 2)))\n", 394 | " \n", 395 | " # Run pyscf.\n", 396 | " molecule = run_pyscf(molecule,\n", 397 | " run_scf=run_scf,\n", 398 | " run_mp2=run_mp2,\n", 399 | " run_cisd=run_cisd,\n", 400 | " run_ccsd=run_ccsd,\n", 401 | " run_fci=run_fci)\n", 402 | "\n", 403 | " # Print out some results of calculation.\n", 404 | " print('\\nAt bond length of {} angstrom, molecular hydrogen has:'.format(\n", 405 | " bond_length))\n", 406 | " print('Hartree-Fock energy of {} Hartree.'.format(molecule.hf_energy))\n", 407 | " print('MP2 energy of {} Hartree.'.format(molecule.mp2_energy))\n", 408 | " print('FCI energy of {} Hartree.'.format(molecule.fci_energy))\n", 409 | " print('Nuclear repulsion energy between protons is {} Hartree.'.format(\n", 410 | " molecule.nuclear_repulsion))\n", 411 | " for orbital in range(molecule.n_orbitals):\n", 412 | " print('Spatial orbital {} has energy of {} Hartree.'.format(\n", 413 | " orbital, molecule.orbital_energies[orbital]))\n", 414 | " hf_energies += [molecule.hf_energy]\n", 415 | " fci_energies += [molecule.fci_energy]\n", 416 | "\n", 417 | "# Plot.\n", 418 | "import matplotlib.pyplot as plt\n", 419 | "%matplotlib inline\n", 420 | "\n", 421 | "plt.figure(0)\n", 422 | "plt.plot(bond_lengths, fci_energies, 'x-')\n", 423 | "plt.plot(bond_lengths, hf_energies, 'o-')\n", 424 | "plt.ylabel('Energy in Hartree')\n", 425 | "plt.xlabel('Bond length in angstrom')\n", 426 | "plt.show()" 427 | ] 428 | }, 429 | { 430 | "cell_type": "code", 431 | "execution_count": null, 432 | "metadata": {}, 433 | "outputs": [], 434 | "source": [] 435 | } 436 | ], 437 | "metadata": { 438 | "anaconda-cloud": {}, 439 | "kernelspec": { 440 | "display_name": "Python 3", 441 | "language": "python", 442 | "name": "python3" 443 | }, 444 | "language_info": { 445 | "codemirror_mode": { 446 | "name": "ipython", 447 | "version": 3 448 | }, 449 | "file_extension": ".py", 450 | "mimetype": "text/x-python", 451 | "name": "python", 452 | "nbconvert_exporter": "python", 453 | "pygments_lexer": "ipython3", 454 | "version": "3.6.10" 455 | } 456 | }, 457 | "nbformat": 4, 458 | "nbformat_minor": 1 459 | } 460 | --------------------------------------------------------------------------------