Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Jul 27, 2023
2 parents 2d8d5a7 + 4dec145 commit 9fcc21f
Show file tree
Hide file tree
Showing 16 changed files with 926 additions and 921 deletions.
6 changes: 5 additions & 1 deletion pyqchem/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def build_fchk(parsed_data):
# txt_fchk += get_array_txt('Beta Orbital Energies', 'R', beta_mo_energies)

if 'scf_density' in parsed_data:
total_density = np.array(parsed_data['scf_density']['alpha']) + np.array(parsed_data['scf_density']['beta'])
if 'beta' in parsed_data['scf_density']:
total_density = np.array(parsed_data['scf_density']['alpha']) + np.array(parsed_data['scf_density']['beta'])
else:
total_density = np.array(parsed_data['scf_density']['alpha'])

scf_density = mat_to_vect(total_density)
txt_fchk += get_array_txt('Total SCF Density', 'R', scf_density)

Expand Down
3 changes: 2 additions & 1 deletion pyqchem/parsers/parser_fchk.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ def _get_all_tdm(output):
for i, m in enumerate(re.finditer('Transition density', output)):
indices = np.array(output[m.end() :m.end() + 100].replace('\n', ' ').split(')')[0].split('(')[1].split(','), dtype=int)
n_elements = int(output[m.end() :m.end() + 100].replace('\n', ' ').split(')')[1].split()[2])
nbas = int(np.sqrt(n_elements))
data = output[m.end(): m.end() + n_elements*50].split(')')[1].split()[3:n_elements+3]
tdm_data_dict[tuple(indices)] = np.array(data, dtype=float).tolist()
tdm_data_dict[tuple(indices)] = np.array(data, dtype=float).reshape(nbas, nbas).tolist()

return tdm_data_dict

Expand Down
2 changes: 1 addition & 1 deletion pyqchem/parsers/parser_rasci.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def parser_rasci(output):
'dipole_moment_units': 'ua',
'oscillator_strength': strength,
'configurations': table,
'contributions_fwn': contributions}
'contributions_wfn': contributions}

if nato_occ is not None:
state_dict.update({'natural_occupation_numbers': nato_occ})
Expand Down
Loading

0 comments on commit 9fcc21f

Please sign in to comment.