Skip to content

Commit 98068ab

Browse files
committed
Changing Python class names to GTO and CGF
1 parent aa329d3 commit 98068ab

File tree

15 files changed

+63
-64
lines changed

15 files changed

+63
-64
lines changed

docs/user_interface.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ polynomial, and :math:`N` a normalization constant such that
3535
GTOs are a fundamental building block of CGF (see below) and typically a user would
3636
not directly work with them. Nevertheless, GTO objects can be constructed as follows::
3737

38-
from pyqint import PyQInt, cgf, gto
38+
from pyqint import PyQInt, CGF, GTO
3939

4040
coeff = 1.0 # coefficients only have meaning for GTOs within a CGF
4141
alpha = 0.5
4242
l,m,n = 0,0,0
4343
p = (0,0,0)
44-
G = gto(coeff, p, alpha, l, m, n)
44+
G = GTO(coeff, p, alpha, l, m, n)
4545

4646
.. note::
4747
If you work with individual GTOs, the first parameter to construct the GTO
@@ -62,9 +62,9 @@ is esentially a linear combination of GTOs as given by
6262
To build a CGF, we first have to produce the CGF object and then
6363
add GTOs to it::
6464

65-
from pyqint import PyQInt, cgf
65+
from pyqint import PyQInt, CGF
6666

67-
cgf = cgf([0.0, 0.0, 0.0])
67+
cgf = CGF([0.0, 0.0, 0.0])
6868

6969
cgf.add_gto(0.154329, 3.425251, 0, 0, 0)
7070
cgf.add_gto(0.535328, 0.623914, 0, 0, 0)
@@ -97,15 +97,15 @@ are separated by a distance of 1.4 Bohr.
9797

9898
.. code-block:: python
9999
100-
from pyqint import PyQInt, cgf
100+
from pyqint import PyQInt, CGF
101101
import numpy as np
102102
from copy import deepcopy
103103
104104
# construct integrator object
105105
integrator = PyQInt()
106106
107107
# build CGF for a H atom located at the origin
108-
cgf1 = cgf([0.0, 0.0, 0.0])
108+
cgf1 = CGF([0.0, 0.0, 0.0])
109109
110110
cgf1.add_gto(0.154329, 3.425251, 0, 0, 0)
111111
cgf1.add_gto(0.535328, 0.623914, 0, 0, 0)
@@ -145,15 +145,15 @@ are separated by a distance of 1.4 Bohr.
145145

146146
.. code-block:: python
147147
148-
from pyqint import PyQInt, cgf, gto
148+
from pyqint import PyQInt, CGF
149149
import numpy as np
150150
from copy import deepcopy
151151
152152
# construct integrator object
153153
integrator = PyQInt()
154154
155155
# build CGF for a H atom located at the origin
156-
cgf1 = cgf([0.0, 0.0, 0.0])
156+
cgf1 = CGF([0.0, 0.0, 0.0])
157157
158158
cgf1.add_gto(0.154329, 3.425251, 0, 0, 0)
159159
cgf1.add_gto(0.535328, 0.623914, 0, 0, 0)
@@ -195,15 +195,15 @@ the nuclei are the same.
195195

196196
.. code-block:: python
197197
198-
from pyqint import PyQInt, cgf, gto
198+
from pyqint import PyQInt, CGF
199199
import numpy as np
200200
from copy import deepcopy
201201
202202
# construct integrator object
203203
integrator = PyQInt()
204204
205205
# build CGF for a H atom located at the origin
206-
cgf1 = cgf([0.0, 0.0, 0.0])
206+
cgf1 = CGF([0.0, 0.0, 0.0])
207207
208208
cgf1.add_gto(0.154329, 3.425251, 0, 0, 0)
209209
cgf1.add_gto(0.535328, 0.623914, 0, 0, 0)
@@ -260,15 +260,15 @@ system are calculated.
260260

261261
.. code-block:: python
262262
263-
from pyqint import PyQInt, cgf, gto
263+
from pyqint import PyQInt, CGF
264264
import numpy as np
265265
from copy import deepcopy
266266
267267
# construct integrator object
268268
integrator = PyQInt()
269269
270270
# build CGF for a H atom located at the origin
271-
cgf1 = cgf([0.0, 0.0, 0.0])
271+
cgf1 = CGF([0.0, 0.0, 0.0])
272272
273273
cgf1.add_gto(0.154329, 3.425251, 0, 0, 0)
274274
cgf1.add_gto(0.535328, 0.623914, 0, 0, 0)
@@ -776,13 +776,13 @@ In the example code shown below, the latter is done.
776776
777777
cgfs = []
778778
for n in nuclei:
779-
_cgf = cgf(n[0])
779+
cgf = CGF(n[0])
780780
781-
_cgf.add_gto(0.154329, 3.425251, 0, 0, 0)
782-
_cgf.add_gto(0.535328, 0.623914, 0, 0, 0)
783-
_cgf.add_gto(0.444635, 0.168855, 0, 0, 0)
781+
cgf.add_gto(0.154329, 3.425251, 0, 0, 0)
782+
cgf.add_gto(0.535328, 0.623914, 0, 0, 0)
783+
cgf.add_gto(0.444635, 0.168855, 0, 0, 0)
784784
785-
cgfs.append(_cgf)
785+
cgfs.append(cgf)
786786
787787
res = HF().rhf(mol, basis=cgfs, verbose=True)
788788

meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: "pyqint"
3-
version: "1.0.0"
3+
version: "1.1.0"
44

55
source:
66
path: .

pyqint/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .molecule import Molecule
22
from .pyqint import PyQInt
3-
from .cgf import cgf
4-
from .gto import gto
3+
from .cgf import CGF
4+
from .gto import GTO
55
from .hf import HF
66
from .foster_boys import FosterBoys
77
from .cohp import COHP

pyqint/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "1.0.0"
1+
__version__ = "1.1.0"
22

pyqint/cgf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from .gto import gto
1+
from .gto import GTO
22
from .pyqint import PyCGF
33
from . import spherical_harmonics as sh
44

5-
class cgf:
5+
class CGF:
66
"""
77
Contracted Gaussian Type Orbital
88
"""
@@ -46,7 +46,7 @@ def add_gto(self, c, alpha, l, m, n):
4646
"""
4747
Add Gaussian Type Orbital to Contracted Gaussian Function
4848
"""
49-
self.gtos.append(gto(c, self.p, alpha, l, m, n))
49+
self.gtos.append(GTO(c, self.p, alpha, l, m, n))
5050
self.cgf.add_gto(c, alpha, l, m, n)
5151

5252
def add_spherical_gto(self, c, alpha, l, m):

pyqint/gto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .pyqint import PyGTO
22

3-
class gto:
3+
class GTO:
44
"""
55
Primitive Gaussian Type Orbital
66
"""

pyqint/molecule.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import os
55
import numpy as np
6-
from .cgf import cgf
6+
from .cgf import CGF
77
from .element import Element
88

99
class Molecule:
@@ -88,47 +88,47 @@ def build_basis(self, name):
8888
for cgf_t in cgfs_template['cgfs']:
8989
# s-orbitals
9090
if cgf_t['type'] == 'S':
91-
self.__cgfs.append(cgf(atom[1]))
91+
self.__cgfs.append(CGF(atom[1]))
9292
for gto in cgf_t['gtos']:
9393
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 0, 0)
9494

9595
# p-orbitals
9696
if cgf_t['type'] == 'P':
97-
self.__cgfs.append(cgf(atom[1]))
97+
self.__cgfs.append(CGF(atom[1]))
9898
for gto in cgf_t['gtos']:
9999
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 1, 0, 0)
100100

101-
self.__cgfs.append(cgf(atom[1]))
101+
self.__cgfs.append(CGF(atom[1]))
102102
for gto in cgf_t['gtos']:
103103
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 1, 0)
104104

105-
self.__cgfs.append(cgf(atom[1]))
105+
self.__cgfs.append(CGF(atom[1]))
106106
for gto in cgf_t['gtos']:
107107
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 0, 1)
108108

109109
# d-orbitals
110110
if cgf_t['type'] == 'D':
111-
self.__cgfs.append(cgf(atom[1]))
111+
self.__cgfs.append(CGF(atom[1]))
112112
for gto in cgf_t['gtos']:
113113
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 2, 0, 0)
114114

115-
self.__cgfs.append(cgf(atom[1]))
115+
self.__cgfs.append(CGF(atom[1]))
116116
for gto in cgf_t['gtos']:
117117
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 2, 0)
118118

119-
self.__cgfs.append(cgf(atom[1]))
119+
self.__cgfs.append(CGF(atom[1]))
120120
for gto in cgf_t['gtos']:
121121
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 0, 2)
122122

123-
self.__cgfs.append(cgf(atom[1]))
123+
self.__cgfs.append(CGF(atom[1]))
124124
for gto in cgf_t['gtos']:
125125
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 1, 1, 0)
126126

127-
self.__cgfs.append(cgf(atom[1]))
127+
self.__cgfs.append(CGF(atom[1]))
128128
for gto in cgf_t['gtos']:
129129
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 1, 0, 1)
130130

131-
self.__cgfs.append(cgf(atom[1]))
131+
self.__cgfs.append(CGF(atom[1]))
132132
for gto in cgf_t['gtos']:
133133
self.__cgfs[-1].add_gto(gto['coeff'], gto['alpha'], 0, 1, 1)
134134

tests/test_cgf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import unittest
2-
from pyqint import PyQInt, Molecule, cgf
3-
from copy import deepcopy
2+
from pyqint import PyQInt, Molecule, CGF
43
import numpy as np
54
import os
65

@@ -75,7 +74,7 @@ def testSphericalHarmonicsOnSite(self):
7574
p0 = [0.0, 0.0, 0.0]
7675
for l in range(7):
7776
for m in range(-l, l+1):
78-
orb = cgf(p0)
77+
orb = CGF(p0)
7978
orb.add_spherical_gto(1.0, 1.0, l, m)
8079
basis_functions.append(orb)
8180
# build overlap matrix

tests/test_custom_basis_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from pyqint import Molecule, cgf, HF, MoleculeBuilder
2+
from pyqint import Molecule, CGF, HF, MoleculeBuilder
33
import numpy as np
44

55
class TestCustomBasisSet(unittest.TestCase):
@@ -12,7 +12,7 @@ def test_custom_basis_set_h2(self):
1212

1313
cgfs = []
1414
for n in nuclei:
15-
_cgf = cgf(n[0])
15+
_cgf = CGF(n[0])
1616

1717
_cgf.add_gto(0.154329, 3.425251, 0, 0, 0)
1818
_cgf.add_gto(0.535328, 0.623914, 0, 0, 0)

tests/test_grad.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from pyqint import cgf
2+
from pyqint import CGF
33
import numpy as np
44
import itertools
55

@@ -20,7 +20,7 @@ def test_cgf_grad(self):
2020
for exp in pp:
2121
for p in pp:
2222
l,m,n = exp
23-
cgft = cgf()
23+
cgft = CGF()
2424
cgft.add_gto(0.154329, 3.425251, l, m, n)
2525
cgft.add_gto(0.535328, 0.623914, l, m, n)
2626
cgft.add_gto(0.444635, 0.168855, l, m, n)
@@ -38,7 +38,7 @@ def test_grad_density(self):
3838
for exp in pp:
3939
for p in pp:
4040
l,m,n = exp
41-
cgft = cgf()
41+
cgft = CGF()
4242
cgft.add_gto(0.154329, 3.425251, l, m, n)
4343
cgft.add_gto(0.535328, 0.623914, l, m, n)
4444
cgft.add_gto(0.444635, 0.168855, l, m, n)
@@ -56,7 +56,7 @@ def calculate_derivs_finite_diff(p, h, l=0, m=0, n=0):
5656
r = np.zeros(3)
5757

5858
r[i] = -h
59-
cgft = cgf()
59+
cgft = CGF()
6060
cgft.add_gto(0.154329, 3.425251, l, m, n)
6161
cgft.add_gto(0.535328, 0.623914, l, m, n)
6262
cgft.add_gto(0.444635, 0.168855, l, m, n)
@@ -76,7 +76,7 @@ def calculate_derivs_density_finite_diff(p, h, l=0, m=0, n=0):
7676
r = np.zeros(3)
7777

7878
r[i] = -h
79-
cgft = cgf()
79+
cgft = CGF()
8080
cgft.add_gto(0.154329, 3.425251, l, m, n)
8181
cgft.add_gto(0.535328, 0.623914, l, m, n)
8282
cgft.add_gto(0.444635, 0.168855, l, m, n)

0 commit comments

Comments
 (0)