init_ensembles

libra_py.init_ensembles.init_ext_hamiltonians(ntraj, nnucl, nel, verbose=0)[source]

This function allocates memory for matrices (external objects). The function also creates an array of External_Hamiltonian objects and bind them to the external matrices

Parameters
  • ntraj (int) – The number of trajectories in the ensemble

  • nnucl (int) – The number of nuclear DOF ( usually, = 3* Number_of_atoms)

  • nel (int) – The number of electronic DOF ( usually the number of electronic states)

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

(ham, ham_adi, d1ham_adi, ham_vib), where:

  • ham ( list of ntraj External_Hamiltonian objects ): “External Hamiltonian” objects,

    one per trajectory. These are the “controller” objects that organize the flow of computations and store the results in the matrices bound to them.

  • ham_adi ( list of ntraj MATRIX(nel, nel) ): Electronic Hamiltonian matrices

    coupled to the ham objects

  • d1ham_adi ( list ntraj lists of nnucl MATRIX(nel, nel) objects ): derivatives of

    electronic Hamiltonians w.r.t. nuclear DOFs for each trajectory. Also coupled to the ham objects for the corresponding trajectories.

  • ham_vib ( list of ntraj CMATRIX(nel, nel) ): Vibronic Hamiltonian matrices

    coupled to the ham objects

Return type

tuple

libra_py.init_ensembles.init_mm_Hamiltonians(syst, ff, verbose=0)[source]

This function creates a list of MM Hamiltonians and bind them to the corresponding systems

Parameters
  • syst (list of ntraj System objects) – self-explanatory

  • ff (ForceField object) – defines which force fields to construct for all systems

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

the ensemble of the objects defining the MM Hamiltonians that are also bound to the provided systems.

Return type

(list of ntraj Hamiltonian_Atomistic objects)

libra_py.init_ensembles.init_mols(syst, ntraj, nnucl, verbose=0)[source]

This function creates a list of Nuclear objects and initializes them by extracting info from the provided systems - in “syst”

Parameters
  • ntraj (int) – The number of trajectories in the ensemble

  • nnucl (int) – The number of nuclear DOF ( usually, = 3* Number_of_atoms)

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

mol: self-explanatory

Return type

(list of ntraj Nuclear objects)

libra_py.init_ensembles.init_systems(ntraj, U, filename, format, verbose=0)[source]

This function creates a list of System objects and loads the content into them

Parameters
  • ntraj (int) – The number of trajectories in the ensemble

  • U (Universe object) – The container of the fundamental parameters of atoms

  • filename (string) – The file containg the atomistic system

  • format (string) – The format of the file to load (see LoadMolecule for possible formats)

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

the ensemble of the objects defining the replicas of the system

Return type

(list of ntraj System objects)

libra_py.init_ensembles.init_systems2(ntraj, filename, format, rnd, T, sigma, data_file='elements.dat', verbose=0)[source]

This function creates a list of System objects and loads the content into them, it also randomizes the original input from the coordinate file (by adding coordinate displacements and setting velocities)

Parameters
  • ntraj (int) – The number of trajectories in the ensemble

  • U (Universe object) – The container of the fundamental parameters of atoms

  • filename (string) – The file containg the atomistic system

  • format (string) – The format of the file to load (see LoadMolecule for possible formats)

  • rnd (Random object) – random number generator object

  • T (double) – Target temperature used to initialize momenta of atoms. [ units: K ]

  • sigma (double) – The magnitude of a random displacement of each atom from its center [ units: Bohr ]

  • data_file (double) – The file containing information about elements [ default: “elements.dat” ]

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

the ensemble of the objects defining the replicas of the system

Return type

(list of ntraj System objects)

libra_py.init_ensembles.init_therms(ntraj, nnucl, params, verbose=0)[source]

This function creates a list of Thermostat objects and initializes them according to given parameters

Parameters
  • ntraj (int) – The number of trajectories in the ensemble

  • nnucl (int) – The number of nuclear DOF ( usually, = 3* Number_of_atoms)

  • verbose (int) –

    The parameter controlling the amount of debug printing:

    • 0: no printing [ default ]

    • 1: do print info

Returns

therm: self-explanatory

Return type

(list of ntraj Thermostat objects)