Skip to content

Commit 24ad810

Browse files
committed
Small tweaks
1 parent 405f90d commit 24ad810

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,7 @@ anaconda-upload/*
152152

153153
# managlyph .abo files
154154
*.abo
155-
.vscode
155+
.vscode
156+
157+
*.jpg
158+
*.png

examples/blender_render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def build_orbitals_co():
3030
res = HF().rhf(mol, 'sto3g')
3131
resfb = FosterBoys(res).run()
3232

33-
build(molname, res, resfb, nrows=2, npts=151)
33+
build(molname, res, resfb, nrows=2, npts=100)
3434

3535
def build_orbitals_h2o():
3636
"""

examples/ethylene_symap.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,24 @@ def main():
8484

8585
overlap = P @ overlap @ P.T
8686

87-
fig, ax = plt.subplots(1,1, dpi=144, figsize=(7,7))
87+
fig, ax = plt.subplots(1,1, dpi=300, figsize=(5,5))
8888
plot_matrix(ax, P @ B, basislabels, symlabels)
89+
plt.tight_layout()
90+
plt.savefig('ethylene_symbasis.png')
8991
plt.show()
9092

9193
# construct new basis
94+
integrator = PyQInt()
9295
B = P @ B
9396
cgfs_symad = [CGF() for i in range(len(B))]
9497
for i in range(len(B)): # loop over new basis functions
9598
for j in range(len(cgfs)): # loop over old basis functions
9699
if abs(B[i,j]) > 0.01: # verify non-negligble contribution
97100
for g in cgfs[j].gtos:
98101
cgfs_symad[i].gtos.append(GTO(g.c*B[i,j], g.p, g.alpha, g.l, g.m, g.n))
102+
S = integrator.overlap(cgfs_symad[i], cgfs_symad[i])
103+
for g in cgfs_symad[i].gtos:
104+
g.c /= np.sqrt(S)
99105

100106
# re-perform Hartree-Fock calculation using the symmetry adapted basis
101107
res = HF().rhf(mol, cgfs_symad, verbose=True)
@@ -111,7 +117,8 @@ def plot_matrix(ax, mat, xlabels, ylabels, xlabelrot = 0):
111117
"""
112118
Produce plot of matrix
113119
"""
114-
mv = np.max(np.abs(mat))
120+
#mv = np.max(np.abs(mat))
121+
mv = 1
115122
ax.imshow(mat, vmin=-mv, vmax=mv, cmap='PiYG')
116123
for i in range(mat.shape[0]):
117124
for j in range(mat.shape[1]):

pyqint/blender/blender_render_molecule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def main():
1818
# set the scene
1919
settings = {
20-
'resolution': 1024,
20+
'resolution': 512,
2121
'camera_location': (-10,0,0),
2222
'camera_rotation': (np.pi/2,0,-np.pi/2),
2323
'camera_scale' : 10
@@ -142,7 +142,7 @@ def set_environment(settings):
142142
bpy.context.scene.render.resolution_x = settings['resolution']
143143
bpy.context.scene.render.resolution_y = settings['resolution']
144144
print('Setting resolution to: ', settings['resolution'])
145-
bpy.context.scene.cycles.samples = 2048
145+
bpy.context.scene.cycles.samples = 1024
146146
bpy.context.scene.cycles.tile_size = 2048
147147

148148
# remove cube

pyqint/blenderrender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self):
2626
def render_molecular_orbitals(self, molecule, cgfs, orbc, outpath,
2727
mo_indices=None, sz=5, isovalue=0.03,
2828
prefix='MO', npts=100,
29-
negcol='8f0153', poscol='276419'):
29+
negcol='276419', poscol='8f0153'):
3030
if mo_indices is None: # render all orbitals
3131
mo_indices = np.arange(0, len(orbc))
3232

0 commit comments

Comments
 (0)