Skip to content

Commit 7a751eb

Browse files
authored
Hamiltonian module (#10)
* made code compatible with hamiltonians module * moved atoms example
1 parent 63c1392 commit 7a751eb

File tree

8 files changed

+156
-170
lines changed

8 files changed

+156
-170
lines changed

NOTICE

100755100644
File mode changed.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This plugin library allows the electronic structure package `PySCF <http://githu
1212
Installation
1313
------------
1414

15-
To install the latest versions of OpenFermion, PySCF and OpenFermion-PySCF in development mode:
15+
To install the latest versions of OpenFermion, PySCF and OpenFermion-PySCF in (development mode):
1616

1717
.. code-block:: bash
1818

examples/generate_data.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"""This is a simple script for generating data."""
1414
import os
1515

16-
from openfermion.utils import (make_atomic_ring,
17-
make_atom,
18-
periodic_table)
16+
from openfermion.hamiltonians import make_atomic_ring
1917

2018
from openfermionpyscf import run_pyscf
2119

@@ -26,7 +24,6 @@
2624
basis = 'sto-3g'
2725
max_electrons = 10
2826
spacing = 0.7414
29-
compute_elements = 0
3027

3128
# Select calculations.
3229
force_recompute = 1
@@ -41,11 +38,7 @@
4138
for n_electrons in range(2, max_electrons + 1):
4239

4340
# Initialize.
44-
if compute_elements:
45-
atomic_symbol = periodic_table[n_electrons]
46-
molecule = make_atom(atomic_symbol, basis)
47-
else:
48-
molecule = make_atomic_ring(n_electrons, spacing, basis)
41+
molecule = make_atomic_ring(n_electrons, spacing, basis)
4942
if os.path.exists(molecule.filename + '.hdf5'):
5043
molecule.load()
5144

examples/generate_diatomic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""This is a simple script for generating data."""
1414
import os
1515

16-
from openfermion.utils import MolecularData
16+
from openfermion.hamiltonians import MolecularData
1717

1818
from openfermionpyscf import run_pyscf
1919

examples/openfermionpyscf_demo.ipynb

Lines changed: 147 additions & 149 deletions
Large diffs are not rendered by default.

examples/plotter.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import numpy
1616
import warnings
1717

18-
from openfermion.utils import (make_atom, make_atomic_ring,
19-
MolecularData, periodic_table)
18+
from openfermion.hamiltonians import (make_atom, make_atomic_ring,
19+
MolecularData, periodic_table)
2020

2121

2222
def latex_name(molecule):
@@ -55,19 +55,14 @@ def latex_name(molecule):
5555
y_log = 0
5656

5757
# Set chemical series parameters.
58-
plot_elements = 0
5958
max_electrons = 10
6059
spacing = 0.7414
6160
basis = 'sto-3g'
6261

6362
# Get chemical series.
6463
molecular_series = []
6564
for n_electrons in range(2, max_electrons + 1):
66-
if plot_elements:
67-
atomic_symbol = periodic_table[n_electrons]
68-
molecule = make_atom(atomic_symbol, basis)
69-
else:
70-
molecule = make_atomic_ring(n_electrons, spacing, basis)
65+
molecule = make_atomic_ring(n_electrons, spacing, basis)
7166
molecule.load()
7267
molecular_series += [molecule]
7368

openfermionpyscf/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# limitations under the License.
1212

1313
"""Define version number here and read it from setup.py automatically"""
14-
__version__ = "0.1a1"
14+
__version__ = "0.1a2"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
openfermion>=0.1a0
1+
openfermion>=0.1a2
22
pyscf

0 commit comments

Comments
 (0)