Metadata-Version: 2.1
Name: qcmr.moldenformat
Version: 0.1
Summary: Read and write Molden Format
Author-Email: Mariusz Radon <mariusz.radon@uj.edu.pl>
License: MIT
Requires-Python: >=3.8
Requires-Dist: numpy>=1.23.5
Requires-Dist: wrapfile>=0.1
Requires-Dist: chemelem>=0.1.1
Description-Content-Type: text/markdown

# qcmr.moldenformat

Read and write [Molden Format](https://www.theochem.ru.nl/molden/molden_format.html).

Note: This package provides an interface for files in molden format,
but is not in any way affiliated with Molden program or its Author.

## Usage
* Reading Molden Format:
  ```python
  from qcmr.moldenformat import read_moldenformat
  mf = read_moldenformat('h2o.molden')
  print(mf.atoms)
  print(mf.moenergies)
  ```
  Above, `mf` returned by `read_moldenformat()`is an instance of
  class `MoldenFormat`. It always containing attributes: `atoms` and
  `length_unit`. It may contain other attributes, in particular
  `gbasis` (GTO basis set) or `sbasis` (STO basis set) as well as
  `moenergies`, `mooccups`, `mosyms` and `mocoeffs` related to
  molecular orbitals. These are defined analogously as [data parsed by
  cclib](https://cclib.github.io/data.html). The history of geometry
  optimization is stored in attribute `geometries`. Anything not
  parsed by current implementation is stored as ASCII text in
  attribute `extensions`.

* Writing Molden Format
  ```python
  from qcmr.moldenformat import write_moldenformat
  write_moldenformat(data, 'h2o.molden')
  ```
    Above, `data` could be either a genuine object of class
  `MoldenFormat` (returned by `read_moldenformat()`, see above)
  or any object containing identically named attributes, from which a
  valid `MoldenFormat` object could be constructed. It may also be a
  dictionary containing the relevant attributes as keys. Example of
  such usage:
  ```python
  data = {
      'atoms': [
          ('O', [0.000000,     0.000000,     0.114879]),
          ('H', [0.000000,     0.750347,    -0.459515]),
          ('H', [0.000000,    -0.750347,    -0.459515]),
      ],
      'length_unit': 'Angstrom'
  }
  write_moldenformat(data, 'h2o.molden')
  ```
