Skip to content

Commit

Permalink
Merge pull request #7 from Crespo-Otero-group/dev
Browse files Browse the repository at this point in the history
Prepare for a new release
  • Loading branch information
m-rivera authored Feb 26, 2020
2 parents e455b6f + a98b5fc commit 9e72cec
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 24 deletions.
2 changes: 1 addition & 1 deletion doc/source/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Installation
.. code-block:: bash
cd /path/to/dir/
git clone https://github.research.its.qmul.ac.uk/btx156/fromage.git
git clone https://github.com/Crespo-Otero-group/fromage.git
cd fromage/
2. Install
Expand Down
24 changes: 24 additions & 0 deletions doc/source/script.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,30 @@ using either TDDFT or CIS. Make sure that all of the atoms of one molecule (A)
appear before all of the atoms of the second molecule (B). Also make sure to
print the ``.rwf`` file by using the input tag ``%rwf=filename.rwf``.

Here is an example Gaussian input for a range-separated hybrid TDDFT calculation
up to the fourth excited state:

.. code-block:: html

%chk=title.chk
%mem=[X]GB
%nproc=[X]
#p wb97xd 6-31g* gfprint pop=full

title

0 1
H 0.00 0.00 0.00
C 0.00 0.00 0.00
.
.
.

--link1--
%chk=title.chk
%rwf=title
#p wb97xd 6-31g* td(nstates=4,root=4) gfprint pop=full IOP(3/33=3) geom=allcheck guess=read density=current

Now run:

.. code-block:: bash
Expand Down
5 changes: 3 additions & 2 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ Input
These are all the files needed for the geometry optimisation. Most of them
were already generated from the previous step.

* ``fromage.in``
* ``fromage.in`` (not required for this tutorial)
The input file which contains the specifications for the geometry
optimisation
optimisation. This tutorial uses default specifications, so this is not
required

* ``mol.init.xyz``
See above
Expand Down
2 changes: 1 addition & 1 deletion fromage/utils/dimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Dimer(object):
Attributes
----------
mols : list of two Mol objects
mol_a,mol_b : Mol objects
The two molecules constituting the dimer
alpha, beta, gamma : floats
The describing angles. alpha is the angle between principal axes,
Expand Down
38 changes: 19 additions & 19 deletions fromage/utils/mol/_cell_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,34 +165,31 @@ def trans_from_rad(self, clust_rad):
The translations required for the unit cell to contain the sphere
"""

# determine how many unit cells we need
vectors = deepcopy(self.vectors)

# vectors normal to faces
a_perp = np.cross(vectors[1], vectors[2])
b_perp = np.cross(vectors[2], vectors[0])
c_perp = np.cross(vectors[0], vectors[1])
a_perp = np.cross(self.vectors[1], self.vectors[2])
b_perp = np.cross(self.vectors[2], self.vectors[0])
c_perp = np.cross(self.vectors[0], self.vectors[1])

# the three normalised unit vectors
perp = np.array([a_perp / np.linalg.norm(a_perp), b_perp /
np.linalg.norm(b_perp), c_perp / np.linalg.norm(c_perp)])

trans_count = np.array([1, 1, 1])
# dimensions of the final supercell (translations)
trans_count = np.array([0, 0, 0])

# distances from faces
distances = np.array([0.0, 0.0, 0.0])
# lattice vectors of the quadrant supercell
supercell_vectors = np.zeros((3,3))

new_vectors = deepcopy(vectors)
# distances from origin to each face
distances = np.array([0.0, 0.0, 0.0])

# loop over lattice vectors
for comp in range(3):
while True:
while distances[comp] <= clust_rad:
trans_count[comp] += 1
distances[comp] = np.dot(new_vectors[comp], perp[comp])
new_vectors[comp] = trans_count[comp] * vectors[comp]
if distances[comp] > clust_rad:
break
trans_count -= np.array([1, 1, 1])
supercell_vectors[comp] = trans_count[comp] * self.vectors[comp]
distances[comp] = np.dot(supercell_vectors[comp], perp[comp])

return trans_count

def supercell_for_cluster(self, clust_rad, mode='exc', central_mol=None):
Expand Down Expand Up @@ -371,6 +368,11 @@ def make_cluster(self, clust_rad, mode='exc', central_mol=None):
# seed_atoms will initialise the cluster
seed_atoms = mol_init.Mol([])

# conserve the bonding properties of the original cell
seed_atoms.bonding = supercell.bonding
seed_atoms.thresh = supercell.thresh


# get seed atoms in the shape of the central mol if pertinent
if central_mol:
for atom_i in supercell:
Expand All @@ -385,8 +387,6 @@ def make_cluster(self, clust_rad, mode='exc', central_mol=None):
if atom.v_dist([0, 0, 0]) < clust_rad:
seed_atoms.append(atom)

# refine seed atoms
max_mol_len = 0
# remove incomplete molecules
if mode == 'exc':
clust_atoms = self.gen_exclusive_clust(seed_atoms)
Expand Down
2 changes: 1 addition & 1 deletion tutorial/config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nAt 500
aN 2
bN 2
cN 2
clust_rad 7
clust_rad 3
traAN 3
traBN 3
traCN 3
Expand Down

0 comments on commit 9e72cec

Please sign in to comment.