Skip to content

Commit

Permalink
clean example files
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Apr 15, 2022
1 parent 02c8be8 commit f5914c8
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 23 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 16 additions & 21 deletions examples/python_api.py → examples/general_api_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ def print_csm(data):
print('CSM ' + ' '.join(['{:7.3f}'.format(s) for s in data['csm']]))


#geometries = file_io.get_geometry_from_file_xyz('../old_examples/coord.xyz')
geometries = file_io.get_molecule_from_file_fchk('../old_examples/sf6.fchk', read_multiple=False)
#geometries = file_io.get_geometry_from_file_xyz('data/coord.xyz')
geometries = file_io.get_molecule_from_file_fchk('data/sf6.fchk', read_multiple=False)
mol = Cosymlib(geometries,mode=2)

print(mol.print_edensity_measure('c4'))


# Get structures from files
geometries_list = file_io.get_geometry_from_file_xyz('../old_examples/coord.xyz', read_multiple=True)
fragments_list = file_io.get_geometry_from_file_cor('../old_examples/coord.cor', read_multiple=True)
geometries_list = file_io.get_geometry_from_file_xyz('data/coord.xyz', read_multiple=True)
fragments_list = file_io.get_geometry_from_file_cor('data/coord.cor', read_multiple=True)

# Call shape as method of Geometry class
print_shape_data(geometries_list)
Expand All @@ -54,7 +54,7 @@ def print_csm(data):
print('\nSYMMETRY'
'\n--------')

geometries_list = file_io.get_geometry_from_file_pdb('../old_examples/methane.pdb', read_multiple=True)
geometries_list = file_io.get_geometry_from_file_pdb('data/methane.pdb', read_multiple=True)
print('measure C3: {} '.format(geometries_list[0].get_symmetry_measure('c3')))

# Check multiple calls of symgroup one calculatioin
Expand All @@ -73,48 +73,43 @@ def print_csm(data):
print('\nWFNSYM\n--------')


molecule = file_io.get_molecule_from_file_fchk('h2.fchk', read_multiple=False)

molecule = file_io.get_molecule_from_file_fchk('data/sf6.fchk', read_multiple=False)
print(molecule.electronic_structure.coefficients_a)

print(molecule.electronic_structure.basis)

sym_l=[]
coord_a=molecule.geometry._positions
for at in range(len(molecule.electronic_structure.basis['atoms'])):
sym_l.append(molecule.electronic_structure.basis['atoms'][at]['symbol'])
print(sym_l)
print(coord_a)
measure_dict = molecule.get_wf_symmetry('C2v',
measure_dict = molecule.get_wf_symmetry('Oh',
axis=[0.000000, 0.000000, 1.000000], # valor defecte
# vector_axis2=[-2.027247, 0.000133, -0.898469],
center=[0.002440, -0.000122, 0.017307])
print_csm(measure_dict)




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

geometries_list = file_io.get_geometry_from_file_xyz('../old_examples/coord.xyz', read_multiple=True)
geometries_list = file_io.get_geometry_from_file_xyz('data/coord.xyz', read_multiple=True)
molecules_set = Cosymlib(geometries_list)

molecules_set.print_shape_measure(['SP-4'], central_atom=1)
molecules_set.print_minimum_distortion_path_shape('SP-4', 'SS-4', central_atom=1, max_dev=103, max_gco=200)

geometries_list = file_io.get_geometry_from_file_xyz('../old_examples/coord_2.xyz', read_multiple=True)
geometries_list = file_io.get_geometry_from_file_xyz('data/coord_2.xyz', read_multiple=True)
molecules_set = Cosymlib(geometries_list)

print('\n\n***********{}************'.format('print_electronic_symmetry_measure()'))

molecules_list = file_io.read_generic_structure_file('../old_examples/pirrol.fchk', read_multiple=True)
molecules_set = Cosymlib(molecules_list)
print('\n\n***********{}************'.format('print_info()'))
molecules_set.print_info()
print('\n\n***********{}************'.format('print_wnfsym_irreducible_repr()'))
molecules_set.print_esym_irreducible_repr('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('print_wnfsym_sym_ovelap()'))
molecules_set.print_esym_sym_overlaps('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])
print('\n\n***********{}************'.format('print_wnfsym_sym_matrices()'))
molecules_set.print_esym_matrices('C2v', axis=[0, 0, 1], center=[0.0, 0.0, 0.0])

molecules_set.print_edensity_measure('C2v', axis=[0, 0, 1], center=[1.0, 0.0, 0.0])
molecules_list = file_io.read_generic_structure_file('data/pirrol.fchk', read_multiple=True)
molecules_set = Cosymlib(molecules_list)
molecules_set.print_esym_matrices('C5', axis=[1, 0, 0], center=[0.0, 0.0, 0.0])

print('\n\n***********{}************'.format('print_electronic_symmetry_measure()'))
molecules_set.print_edensity_measure('C5', axis=[1, 0, 0], center=[0.0, 0.0, 0.0])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/normal_modes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def get_nm_vibration_path(geometry, normal_mode, points=10, backward=False, k=1.
return structures_path


molecule = read_generic_structure_file('../old_examples/sf6.fchk')
freq, nm_martices = read_normal_modes_gaussian('../old_examples/sf6_freq.out')
molecule = read_generic_structure_file('data/sf6.fchk')
freq, nm_martices = read_normal_modes_gaussian('data/sf6_freq.out')
k_points = 1.5
points = 10
n_freq = 1
Expand Down

0 comments on commit f5914c8

Please sign in to comment.