Skip to main content

qccodec

Encode qcdata inputs into native quantum chemistry files and decode (parse) program outputs into structured qcdata objects.. Uses data structures from qcdata.

image image image Actions status Actions status

qccodec works in harmony with a suite of other quantum chemistry tools for fast, structured, and interoperable quantum chemistry.

The QC Suite of Programs

The QC Suite works in harmony to provide fast, structured, and interoperable quantum chemistry tools.

  • qcconst - Physical constants, conversion factors, and a periodic table with clear source information for every value.
  • qcdata - Elegant and intuitive data structures for quantum chemistry, featuring seamless Jupyter Notebook visualizations. Documentation
  • qcinf - Cheminformatics algorithms and structure utilities using standardized qcdata data structures.
  • qccodec - A package for translating between standardized qcdata data structures and native QC program inputs and outputs.
  • qccompute - A package for operating quantum chemistry programs using standardized qcdata data structures. Compatible with TeraChem, psi4, QChem, NWChem, ORCA, Molpro, geomeTRIC and many more.
  • BigChem - A distributed application for running quantum chemistry calculations at scale across clusters of computers or the cloud. Bring multi-node scaling to your favorite quantum chemistry program.
  • ChemCloud - A web application and associated Python client for exposing a BigChem cluster securely over the internet.

✨ Basic Usage

  • Installation:

    python -m pip install qccodec
    
  • Parse QC program outputs into structured data files with a single line of code.

    from pathlib import Path
    from qcdata import CalcType
    from qccodec import decode
    
    stdout = Path("tc.out").read_text()
    data = decode("terachem", CalcType.gradient, stdout=stdout)
    
  • The data object will be a qcdata object, either SinglePointData, OptimizationData, ConformerSearchData or other *Data structure depending on the calctype. Run dir(data) inside a Python interpreter to see the various values you can access. A few prominent values are shown here as an example:

    from pathlib import Path
    from qcdata import CalcType
    from qccodec import decode
    
    stdout = Path("tc.out").read_text()
    data = decode("terachem", CalcType.hessian, stdout=stdout)
    
    data.energy
    data.gradient # If a gradient calc
    data.hessian # If a hessian calc
    data.calcinfo_nmo # Number of molecular orbitals
    
  • Parsed values can be written to disk like this:

    with open("data.json", "w") as f:
        f.write(data.model_dumps_json())
    
  • And read from disk like this:

    from qcdata import SinglePointData
    
    data = SinglePointData.open("data.json")
    
  • You can also run qccodec from the command line like this:

    qccodec -h # Get help message for cli
    
    qccodec terachem hessian tests/data/terachem/water.frequencies.out > data.json # Parse TeraChem stdout to json
    
  • More complex parsing can be accomplished by passing the directory containing the scratch files to decode and optionally the input data used to generate the calculation (usually done from qcop which uses structure data):

    from pathlib import Path
    from qcdata import CalcType, ProgramInput
    from qccodec import decode
    
    stdout = Path("tc.out").read_text()
    directory = Path(".") / "scr.geom"
    input_data = ProgramInput.open("prog_inp.json")
    
    data = decode("terachem", CalcType.hessian, stdout=stdout, directory=directory, input_data=input_data)
    

💻 Contributing

Please see the contributing guide for details on how to contribute new parsers to this project :)

If there's data you'd like parsed from output files or want to support input files for a new program, please open an issue in this repo explaining the data items you'd like parsed and include an example output file containing the data, like this.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qccodec-0.11.2.tar.gz (546.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qccodec-0.11.2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file qccodec-0.11.2.tar.gz.

File metadata

  • Download URL: qccodec-0.11.2.tar.gz
  • Upload date:
  • Size: 546.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qccodec-0.11.2.tar.gz
Algorithm Hash digest
SHA256 000a6557ccaf2cda6252546ae34dcfaa744a76b56884e694565819455694400f
MD5 dd3ea5db3a0f8f60927e7be6b45dfd61
BLAKE2b-256 b3abba62c57116ae7ed94a1a07015222e6ad5b9b447ba938f58ac6c607f609f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qccodec-0.11.2.tar.gz:

Publisher: publish-to-pypi.yaml on atomsforhumanity/qccodec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qccodec-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: qccodec-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qccodec-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38e838d2a85dc6649f3b7c0b65270a5d06c0152aa5e32a815004aafe94968f70
MD5 420efbb24e5f4b24887a1bfdd7aefd77
BLAKE2b-256 e2ff5f1494880dd4bfcc4377ef5f901637d4a15dd70abf13a1327c6d6e1ec8c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for qccodec-0.11.2-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on atomsforhumanity/qccodec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.11.2 This release

2 files

0.11.1

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.8

2 files

0.7.7

2 files

0.7.6

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page