Skip to content

Commit

Permalink
minor format details
Browse files Browse the repository at this point in the history
added coors_2.xyz example for autogenerated electronic structure
  • Loading branch information
abelcarreras committed Apr 14, 2020
1 parent 2c495e8 commit d9709a9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
13 changes: 6 additions & 7 deletions cosymlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,29 +271,28 @@ def print_symmetry_nearest_structure(self, label, multi=1, central_atom=0, conne

output.write(file_io.get_file_xyz_txt(geometry))

# This should just call methos within this class
# This should be substituted by calling methods within this class
def OLD_print_wnfsym_measure_verbose(self, group, axis=None, axis2=None, center=None, output=sys.stdout):
self.print_wnfsym_sym_matrices(group, axis=None, axis2=None, center=None, output=sys.stdout)
self.print_wnfsym_irreducible_repr(group, axis=None, axis2=None, center=None, output=sys.stdout)
self.print_wnfsym_sym_matrices(group, axis=axis, axis2=axis2, center=center, output=output)
self.print_wnfsym_irreducible_repr(group, axis=axis, axis2=axis2, center=center, output=output)

def print_electronic_symmetry_measure(self, group, axis=None, axis2=None, center=None, output=sys.stdout):

txt = ''
first = True
for molecule in self._molecules:
wf_measure = molecule.get_wf_symmetry(group, axis=axis, axis2=axis2, center=center)
wf_ir = molecule.get_wf_irreducible_representations(group, axis=axis, axis2=axis2, center=center)

if first:
sep_line = ' ' + '---------' * len(wf_measure['labels']) + '\n'
sep_line = ' ' + '---------' * len(wf_measure['labels']) + '\n'

txt += '\nWaveFunction: CSM-like values\n'
txt += sep_line
txt += ' ' + ' '.join(['{:^7}'.format(s) for s in wf_measure['labels']])
txt += ' ' + ' '.join(['{:^7}'.format(s) for s in wf_measure['labels']])
txt += '\n'
txt += sep_line

txt += '{:.10} '.format(molecule.name) + ' '.join(['{:7.3f}'.format(s) for s in wf_measure['csm']])
txt += '{:<9} '.format(molecule.name) + ' '.join(['{:7.3f}'.format(s) for s in wf_measure['csm']])
txt += '\n'
first = False

Expand Down
18 changes: 18 additions & 0 deletions examples/coord_2.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
5
Methane
C 0.0000 0.0000 0.0000
H 0.6252 0.6252 0.6252
H -0.6252 -0.6252 0.6252
H -0.6252 0.6252 -0.6252
H 0.6252 -0.6252 -0.6252
4
Ammonia
N 0.0000 0.0000 0.1000
H 0.5288 0.1610 0.9359
H 0.2051 0.8240 -0.6786
H 0.3345 -0.9314 -0.4496
3
Water
O 0.0000 0.0000 0.1140
H 0.0000 0.7808 -0.4562
H 0.0000 -0.7808 -0.4561
14 changes: 12 additions & 2 deletions examples/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def print_csm(data):


molecule = file_io.get_molecule_from_file_fchk('pirrol.fchk')
molecules_set = file_io.read_generic_structure_file('pirrol.fchk', read_multiple=True)

data = molecule.get_wf_symmetry('C2v',
axis=[0.000000, 0.000000, 1.000000], # valor defecte
Expand All @@ -77,12 +76,23 @@ def print_csm(data):
print_csm(data)

print('\nCOSYMLIB\n--------')

molecules_set = file_io.get_geometry_from_file_xyz('coord_2.xyz', read_multiple=True)
molecules_group = Cosymlib(molecules_set)
print('\n\n***********{}************'.format('print_electronic_symmetry_measure()'))
molecules_group.print_electronic_symmetry_measure('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])


molecules_set = file_io.read_generic_structure_file('pirrol.fchk', read_multiple=True)
molecules_group = Cosymlib(molecules_set)
print('\n\n***********{}************'.format('print_info()'))
molecules_group.print_info()
print('\n\n***********{}************'.format('print_wnfsym_irreducible_repr()'))
molecules_group.print_wnfsym_irreducible_repr('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('print_wnfsym_sym_ovelap()'))
molecules_group.print_wnfsym_sym_ovelap('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('print_wnfsym_sym_matrices()'))
molecules_group.print_wnfsym_sym_matrices('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('plot_mo_diagram()'))
molecules_group.plot_mo_diagram('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('plot_sym_energy_evolution()'))
molecules_group.plot_sym_energy_evolution('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])

0 comments on commit d9709a9

Please sign in to comment.