Full Code of choderalab/espaloma for AI

main 413eb5507403 cached
297 files
652.0 KB
179.3k tokens
455 symbols
1 requests
Download .txt
Showing preview only (730K chars total). Download the full file or copy to clipboard to get everything.
Repository: choderalab/espaloma
Branch: main
Commit: 413eb5507403
Files: 297
Total size: 652.0 KB

Directory structure:
gitextract_8sr_6d4i/

├── .codecov.yml
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── CI.yaml
│       ├── clean_cache.yaml
│       └── docker.yaml
├── .gitignore
├── .readthedocs.yaml
├── LICENSE
├── MANIFEST.in
├── README.md
├── devtools/
│   ├── README.md
│   ├── conda-envs/
│   │   └── espaloma.yaml
│   ├── conda-recipe/
│   │   ├── build.sh
│   │   └── meta.yml
│   ├── gh-actions/
│   │   └── initialize_conda.sh
│   └── scripts/
│       └── create_conda_env.py
├── docker/
│   └── Dockerfile
├── docs/
│   ├── Makefile
│   ├── README.md
│   ├── _static/
│   │   └── README.md
│   ├── _templates/
│   │   ├── README.md
│   │   ├── custom-class-template.rst
│   │   └── custom-module-template.rst
│   ├── api.rst
│   ├── autosummary/
│   │   ├── espaloma.data.collection.alkethoh.rst
│   │   ├── espaloma.data.collection.esol.rst
│   │   ├── espaloma.data.collection.md17_new.rst
│   │   ├── espaloma.data.collection.md17_old.rst
│   │   ├── espaloma.data.collection.qca.rst
│   │   ├── espaloma.data.collection.rst
│   │   ├── espaloma.data.collection.zinc.rst
│   │   ├── espaloma.data.dataset.Dataset.rst
│   │   ├── espaloma.data.dataset.GraphDataset.rst
│   │   ├── espaloma.data.dataset.rst
│   │   ├── espaloma.data.md.MoleculeVacuumSimulation.rst
│   │   ├── espaloma.data.md.rst
│   │   ├── espaloma.data.md.subtract_nonbonded_force.rst
│   │   ├── espaloma.data.md.subtract_nonbonded_force_except_14.rst
│   │   ├── espaloma.data.md17_utils.get_molecule.rst
│   │   ├── espaloma.data.md17_utils.realize_molecule.rst
│   │   ├── espaloma.data.md17_utils.rst
│   │   ├── espaloma.data.md17_utils.sum_offsets.rst
│   │   ├── espaloma.data.normalize.BaseNormalize.rst
│   │   ├── espaloma.data.normalize.DatasetLogNormalNormalize.rst
│   │   ├── espaloma.data.normalize.DatasetNormalNormalize.rst
│   │   ├── espaloma.data.normalize.ESOL100LogNormalNormalize.rst
│   │   ├── espaloma.data.normalize.ESOL100NormalNormalize.rst
│   │   ├── espaloma.data.normalize.NotNormalize.rst
│   │   ├── espaloma.data.normalize.PositiveNotNormalize.rst
│   │   ├── espaloma.data.normalize.rst
│   │   ├── espaloma.data.qcarchive_utils.MolWithTargets.rst
│   │   ├── espaloma.data.qcarchive_utils.breakdown_along_time_axis.rst
│   │   ├── espaloma.data.qcarchive_utils.fetch_td_record.rst
│   │   ├── espaloma.data.qcarchive_utils.get_client.rst
│   │   ├── espaloma.data.qcarchive_utils.get_collection.rst
│   │   ├── espaloma.data.qcarchive_utils.get_energy_and_gradient.rst
│   │   ├── espaloma.data.qcarchive_utils.get_graph.rst
│   │   ├── espaloma.data.qcarchive_utils.h5_to_dataset.rst
│   │   ├── espaloma.data.qcarchive_utils.make_batch_size_consistent.rst
│   │   ├── espaloma.data.qcarchive_utils.rst
│   │   ├── espaloma.data.qcarchive_utils.weight_by_snapshots.rst
│   │   ├── espaloma.data.rst
│   │   ├── espaloma.data.utils.batch.rst
│   │   ├── espaloma.data.utils.collate_fn.rst
│   │   ├── espaloma.data.utils.from_csv.rst
│   │   ├── espaloma.data.utils.infer_mol_from_coordinates.rst
│   │   ├── espaloma.data.utils.make_temp_directory.rst
│   │   ├── espaloma.data.utils.normalize.rst
│   │   ├── espaloma.data.utils.rst
│   │   ├── espaloma.data.utils.split.rst
│   │   ├── espaloma.data.utils.sum_offsets.rst
│   │   ├── espaloma.graphs.deploy.load_forcefield.rst
│   │   ├── espaloma.graphs.deploy.openmm_system_from_graph.rst
│   │   ├── espaloma.graphs.deploy.rst
│   │   ├── espaloma.graphs.graph.BaseGraph.rst
│   │   ├── espaloma.graphs.graph.Graph.rst
│   │   ├── espaloma.graphs.graph.rst
│   │   ├── espaloma.graphs.legacy_force_field.LegacyForceField.rst
│   │   ├── espaloma.graphs.legacy_force_field.rst
│   │   ├── espaloma.graphs.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.angle_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.atom_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.bond_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.improper_torsion_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.proper_torsion_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.duplicate_index_ordering.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.from_homogeneous_and_mol.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.relationship_indices_from_offmol.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.fp_oe.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.fp_rdkit.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_oemol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_openff_toolkit_mol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_rdkit_mol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.rst
│   │   ├── espaloma.graphs.utils.rst
│   │   ├── espaloma.mm.angle.angle_high.rst
│   │   ├── espaloma.mm.angle.bond_angle.rst
│   │   ├── espaloma.mm.angle.bond_bond.rst
│   │   ├── espaloma.mm.angle.harmonic_angle.rst
│   │   ├── espaloma.mm.angle.linear_mixture_angle.rst
│   │   ├── espaloma.mm.angle.rst
│   │   ├── espaloma.mm.angle.urey_bradley.rst
│   │   ├── espaloma.mm.bond.bond_high.rst
│   │   ├── espaloma.mm.bond.gaussian_bond.rst
│   │   ├── espaloma.mm.bond.harmonic_bond.rst
│   │   ├── espaloma.mm.bond.linear_mixture_bond.rst
│   │   ├── espaloma.mm.bond.rst
│   │   ├── espaloma.mm.energy.CarryII.rst
│   │   ├── espaloma.mm.energy.EnergyInGraph.rst
│   │   ├── espaloma.mm.energy.EnergyInGraphII.rst
│   │   ├── espaloma.mm.energy.apply_angle.rst
│   │   ├── espaloma.mm.energy.apply_angle_ii.rst
│   │   ├── espaloma.mm.energy.apply_angle_linear_mixture.rst
│   │   ├── espaloma.mm.energy.apply_bond.rst
│   │   ├── espaloma.mm.energy.apply_bond_gaussian.rst
│   │   ├── espaloma.mm.energy.apply_bond_ii.rst
│   │   ├── espaloma.mm.energy.apply_bond_linear_mixture.rst
│   │   ├── espaloma.mm.energy.apply_improper_torsion.rst
│   │   ├── espaloma.mm.energy.apply_nonbonded.rst
│   │   ├── espaloma.mm.energy.apply_torsion.rst
│   │   ├── espaloma.mm.energy.apply_torsion_ii.rst
│   │   ├── espaloma.mm.energy.energy_in_graph.rst
│   │   ├── espaloma.mm.energy.energy_in_graph_ii.rst
│   │   ├── espaloma.mm.energy.rst
│   │   ├── espaloma.mm.functional.gaussian.rst
│   │   ├── espaloma.mm.functional.harmonic.rst
│   │   ├── espaloma.mm.functional.harmonic_harmonic_coupled.rst
│   │   ├── espaloma.mm.functional.harmonic_harmonic_periodic_coupled.rst
│   │   ├── espaloma.mm.functional.harmonic_periodic_coupled.rst
│   │   ├── espaloma.mm.functional.linear_mixture.rst
│   │   ├── espaloma.mm.functional.linear_mixture_to_original.rst
│   │   ├── espaloma.mm.functional.lj.rst
│   │   ├── espaloma.mm.functional.periodic.rst
│   │   ├── espaloma.mm.functional.periodic_fixed_phases.rst
│   │   ├── espaloma.mm.functional.rst
│   │   ├── espaloma.mm.geometry.GeometryInGraph.rst
│   │   ├── espaloma.mm.geometry.angle.rst
│   │   ├── espaloma.mm.geometry.apply_angle.rst
│   │   ├── espaloma.mm.geometry.apply_bond.rst
│   │   ├── espaloma.mm.geometry.apply_torsion.rst
│   │   ├── espaloma.mm.geometry.copy_src.rst
│   │   ├── espaloma.mm.geometry.dihedral.rst
│   │   ├── espaloma.mm.geometry.distance.rst
│   │   ├── espaloma.mm.geometry.geometry_in_graph.rst
│   │   ├── espaloma.mm.geometry.reduce_stack.rst
│   │   ├── espaloma.mm.geometry.rst
│   │   ├── espaloma.mm.nonbonded.arithmetic_mean.rst
│   │   ├── espaloma.mm.nonbonded.geometric_mean.rst
│   │   ├── espaloma.mm.nonbonded.lj_12_6.rst
│   │   ├── espaloma.mm.nonbonded.lj_9_6.rst
│   │   ├── espaloma.mm.nonbonded.lorentz_berthelot.rst
│   │   ├── espaloma.mm.nonbonded.rst
│   │   ├── espaloma.mm.rst
│   │   ├── espaloma.mm.torsion.angle_angle.rst
│   │   ├── espaloma.mm.torsion.angle_angle_torsion.rst
│   │   ├── espaloma.mm.torsion.angle_torsion.rst
│   │   ├── espaloma.mm.torsion.bond_torsion.rst
│   │   ├── espaloma.mm.torsion.periodic_torsion.rst
│   │   ├── espaloma.mm.torsion.rst
│   │   ├── espaloma.nn.baselines.FreeParameterBaseline.rst
│   │   ├── espaloma.nn.baselines.FreeParameterBaselineInitMean.rst
│   │   ├── espaloma.nn.baselines.rst
│   │   ├── espaloma.nn.layers.dgl_legacy.GN.rst
│   │   ├── espaloma.nn.layers.dgl_legacy.rst
│   │   ├── espaloma.nn.layers.rst
│   │   ├── espaloma.nn.readout.base_readout.BaseReadout.rst
│   │   ├── espaloma.nn.readout.base_readout.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.ChargeEquilibrium.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.get_charges.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.rst
│   │   ├── espaloma.nn.readout.graph_level_readout.GraphLevelReadout.rst
│   │   ├── espaloma.nn.readout.graph_level_readout.rst
│   │   ├── espaloma.nn.readout.janossy.ExpCoefficients.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPooling.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPoolingImproper.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPoolingNonbonded.rst
│   │   ├── espaloma.nn.readout.janossy.LinearMixtureToOriginal.rst
│   │   ├── espaloma.nn.readout.janossy.rst
│   │   ├── espaloma.nn.readout.node_typing.NodeTyping.rst
│   │   ├── espaloma.nn.readout.node_typing.rst
│   │   ├── espaloma.nn.readout.rst
│   │   ├── espaloma.nn.rst
│   │   ├── espaloma.nn.sequential.Sequential.rst
│   │   └── espaloma.nn.sequential.rst
│   ├── conf.py
│   ├── deploy.rst
│   ├── download_experiments.sh
│   ├── experiments/
│   │   ├── index.rst
│   │   ├── mm_fitting_small.rst
│   │   ├── qm_fitting.rst
│   │   └── typing.rst
│   ├── index.rst
│   ├── install.rst
│   ├── make.bat
│   └── qm_fitting.rst
├── espaloma/
│   ├── .py
│   ├── __init__.py
│   ├── _version.py
│   ├── app/
│   │   ├── __init__.py
│   │   ├── experiment.py
│   │   ├── report.py
│   │   ├── tests/
│   │   │   └── test_experiment.py
│   │   ├── train.py
│   │   ├── train_all_params.py
│   │   ├── train_bonded_energy.py
│   │   └── train_multi_typing.py
│   ├── data/
│   │   ├── __init__.py
│   │   ├── collection.py
│   │   ├── dataset.py
│   │   ├── md.py
│   │   ├── md17_utils.py
│   │   ├── normalize.py
│   │   ├── off-mol_0_10_6.json
│   │   ├── qcarchive_utils.py
│   │   ├── tests/
│   │   │   ├── test_collection.py
│   │   │   ├── test_dataset.py
│   │   │   ├── test_md.py
│   │   │   ├── test_normalize.py
│   │   │   ├── test_qcarchive.py
│   │   │   └── test_save_and_load.py
│   │   └── utils.py
│   ├── graphs/
│   │   ├── __init__.py
│   │   ├── deploy.py
│   │   ├── graph.py
│   │   ├── legacy_force_field.py
│   │   ├── tests/
│   │   │   ├── test_deploy.py
│   │   │   ├── test_gaff_parametrize.py
│   │   │   ├── test_graph.py
│   │   │   └── test_smirnoff.py
│   │   └── utils/
│   │       ├── __init__.py
│   │       ├── offmol_indices.py
│   │       ├── read_heterogeneous_graph.py
│   │       ├── read_homogeneous_graph.py
│   │       └── regenerate_impropers.py
│   ├── metrics.py
│   ├── mm/
│   │   ├── __init__.py
│   │   ├── angle.py
│   │   ├── bond.py
│   │   ├── energy.py
│   │   ├── functional.py
│   │   ├── geometry.py
│   │   ├── nonbonded.py
│   │   ├── tests/
│   │   │   ├── system.xml
│   │   │   ├── test_angle.py
│   │   │   ├── test_angle_energy.py
│   │   │   ├── test_bond_energy.py
│   │   │   ├── test_charge_energy_consistency.py
│   │   │   ├── test_charge_energy_consistency_hardcode.py
│   │   │   ├── test_dihedral.py
│   │   │   ├── test_distance.py
│   │   │   ├── test_energy.py
│   │   │   ├── test_energy_gaussian.py
│   │   │   ├── test_energy_ii.py
│   │   │   ├── test_geometry.py
│   │   │   ├── test_linear_combination.py
│   │   │   ├── test_openmm_consistency.py
│   │   │   └── test_recoverability.py
│   │   └── torsion.py
│   ├── nn/
│   │   ├── __init__.py
│   │   ├── baselines.py
│   │   ├── layers/
│   │   │   ├── __init__.py
│   │   │   └── dgl_legacy.py
│   │   ├── readout/
│   │   │   ├── __init__.py
│   │   │   ├── base_readout.py
│   │   │   ├── charge_equilibrium.py
│   │   │   ├── graph_level_readout.py
│   │   │   ├── janossy.py
│   │   │   └── node_typing.py
│   │   ├── sequential.py
│   │   └── tests/
│   │       ├── test_baseline.py
│   │       ├── test_janossy.py
│   │       └── test_simple_net.py
│   ├── units.py
│   └── utils/
│       ├── geometry.py
│       ├── model_fetch.py
│       └── tests/
│           └── test_model_fetch.py
├── requirements.txt
├── scripts/
│   ├── README.md
│   └── perses-benchmark/
│       ├── README.md
│       ├── espaloma-perses.export.yaml
│       ├── espaloma-perses.yaml
│       └── tyk2/
│           ├── README.md
│           ├── espaloma-0.2.2/
│           │   ├── LSF-job-template.sh
│           │   ├── README.md
│           │   ├── benchmark_analysis.py
│           │   ├── run_benchmarks.py
│           │   └── template.yaml
│           └── openff-1.2.0/
│               ├── LSF-job-template.sh
│               ├── README.md
│               ├── benchmark_analysis.py
│               ├── run_benchmarks.py
│               └── template.yaml
├── setup.cfg
├── setup.py
└── versioneer.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .codecov.yml
================================================
# Codecov configuration to make it a bit less noisy
coverage:
  status:
    patch: false
    project:
      default:
        threshold: 50%
comment:
  layout: "header"
  require_changes: false
  branches: null
  behavior: default
  flags: null
  paths: null


================================================
FILE: .gitattributes
================================================
*.ipynb linguist-documentation
*.html linguist-documentation
espaloma/_version.py export-subst


================================================
FILE: .github/workflows/CI.yaml
================================================
name: CI

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main 

  schedule:
    # Nightly tests run on master by default:
    #   Scheduled workflows run on the latest commit on the default or base branch.
    #   (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
    - cron: "0 0 * * *"

concurrency:
  group: "${{ github.workflow }}-${{ github.ref }}"
  cancel-in-progress: true

defaults:
  run:
    shell: bash -leo pipefail {0}

jobs:
  test:
    name: ${{ matrix.os }}, Python ${{ matrix.python-version }}
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: ['ubuntu','macos']
        python-version:
          - "3.12"
          - "3.11"
          - "3.10"

    env:
      OPENMM: ${{ matrix.cfg.openmm }}
      OE_LICENSE: ${{ github.workspace }}/oe_license.txt

    steps:
      - uses: actions/checkout@v3
      - name: Get current date
        id: date
        run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"  
      - uses: mamba-org/setup-micromamba@v1
        with:
          environment-file: devtools/conda-envs/espaloma.yaml
          cache-environment: true
          cache-downloads: true
          cache-environment-key: environment-${{ steps.date.outputs.date }}
          cache-downloads-key: downloads-${{ steps.date.outputs.date }}
          create-args: >-
            python=${{ matrix.python-version }}

      - name: Additional info about the build
        shell: bash
        run: |
          uname -a
          df -h
          ulimit -a

      - name: Environment Information
        run: |
          micromamba info
          micromamba list
          micromamba --version

      - name: Install package
        run: |
          python -m pip install --no-deps -e .

      - name: Run tests
        run: |
          pytest -v --cov=espaloma --cov-report=xml --color=yes espaloma/

      - name: CodeCov
        uses: codecov/codecov-action@v3
        if: ${{ github.repository == 'choderalab/espaloma'
                && github.event_name == 'pull_request' }} 
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage.xml
          flags: unittests
          yml: ./.codecov.yml
          fail_ci_if_error: False
          verbose: True


================================================
FILE: .github/workflows/clean_cache.yaml
================================================
# from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
name: cleanup caches by a branch
on:
  pull_request:
    types:
      - closed

jobs:
  cleanup:
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v3
        
      - name: Cleanup
        run: |
          gh extension install actions/gh-actions-cache
          
          REPO=${{ github.repository }}
          BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

          echo "Fetching list of cache key"
          cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )

          ## Setting this to not fail the workflow while deleting cache keys. 
          set +e
          echo "Deleting caches..."
          for cacheKey in $cacheKeysForPR
          do
              gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
          done
          echo "Done"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .github/workflows/docker.yaml
================================================
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Create and publish a Docker image

on:
  workflow_dispatch:

defaults:
  run:
    shell: bash -l {0}

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: choderalab/espaloma

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Free disk space
        run: |
          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
          sudo rm -rf \
            /usr/share/dotnet /usr/local/lib/android /opt/ghc \
            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
            /usr/lib/jvm || true
          echo "some directories deleted"
          sudo apt install aptitude -y >/dev/null 2>&1
          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
            google-cloud-sdk imagemagick \
            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
            mercurial apt-transport-https mono-complete libmysqlclient \
            unixodbc-dev yarn chrpath libssl-dev libxft-dev \
            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
            snmp pollinate libpq-dev postgresql-client powershell ruby-full \
            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
            -y -f >/dev/null 2>&1
          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
          sudo apt-get autoremove -y >/dev/null 2>&1
          sudo apt-get autoclean -y >/dev/null 2>&1
          echo "some packages purged"

      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Get Latest Version
        id: latest-version
        run: |
          LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
          echo $LATEST_TAG
          echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT
          VERSION=$LATEST_TAG
          echo $VERSION
          echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

      - name: Print Latest Version
        run: echo ${{ steps.latest-version.outputs.VERSION }}

      # Now that we got the version, we don't need the .git folder
      - name: Get more space
        run: |
          df . -h
          sudo rm -rf ${GITHUB_WORKSPACE}/.git
          df . -h

      - name: Create fully qualified image registry path
        id: fqirp
        run: |
          FQIRP=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.latest-version.outputs.VERSION }}
          echo "FQIRP=$FQIRP" >> $GITHUB_OUTPUT

      - name: Print FQIRP
        run: echo ${{ steps.fqirp.outputs.FQIRP  }}

      - name: Log in to the Container registry
        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          tags: |
            type=schedule,pattern=nightly,enable=true,priority=1000
            type=ref,event=branch,enable=true,priority=600
            type=ref,event=tag,enable=true,priority=600
            type=ref,event=pr,prefix=pr-,enable=true,priority=600
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{version}}
            type=sha
            ${{ steps.latest-version.outputs.VERSION }}

      - name: Build and export to Docker
        uses: docker/build-push-action@v4
        with:
          context: .
          file: docker/Dockerfile
          load: true
          push: false
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          build-args: |
            VERSION=${{ steps.latest-version.outputs.VERSION }}

      - name: Test image
        run: |
          docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import espaloma; print(espaloma.__version__)"
          docker run --rm ${{ steps.fqirp.outputs.FQIRP }} pytest --pyargs espaloma -v

      - name: Push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          file: docker/Dockerfile
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          build-args: |
            VERSION=${{ steps.latest-version.outputs.VERSION }}

      - name: Setup Apptainer
        uses: eWaterCycle/setup-apptainer@v2
        with:
          apptainer-version: 1.1.2

      - name: Build Apptainer Image
        run: singularity build espaloma_${{ steps.latest-version.outputs.VERSION }}.sif docker-daemon:${{ steps.fqirp.outputs.FQIRP }}

      - name: Test & Push Apptainer Image
        run: |
          mkdir test_apptainer
          cd test_apptainer
          singularity run ../espaloma_${{ steps.latest-version.outputs.VERSION }}.sif pytest --pyargs espaloma -v
          echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
          singularity push ../espaloma_${{ steps.latest-version.outputs.VERSION }}.sif oras://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.latest-version.outputs.VERSION }}-apptainer


================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# data
*.sdf
*.csv

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Parm@Frosst download
parm_at_Frosst.tgz

# misc
.DS_Store


================================================
FILE: .readthedocs.yaml
================================================
version: 2

build:
  os: "ubuntu-20.04"
  tools:
    python: "mambaforge-4.10"

sphinx:
   configuration: docs/conf.py
   fail_on_warning: false

conda:
  environment: devtools/conda-envs/espaloma.yaml

python:
  # Install our python package before building the docs
  install:
    - method: pip
      path: .


================================================
FILE: LICENSE
================================================

MIT License

Copyright (c) 2020 Yuanqing Wang @ choderalab // MSKCC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
include LICENSE
include MANIFEST.in
include versioneer.py

graft espaloma
global-exclude *.py[cod] __pycache__ *.so

================================================
FILE: README.md
================================================
espaloma: **E**xtensible **S**urrogate **P**otenti**al** **O**ptimized by **M**essage-passing **A**lgorithms 🍹
==============================
[//]: # (Badges)
[![CI](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml/badge.svg?branch=main)](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml)
[![Documentation Status](https://readthedocs.org/projects/espaloma/badge/?version=latest)](https://espaloma.readthedocs.io/en/latest/?badge=latest)

Source code for [Wang Y, Fass J, and Chodera JD "End-to-End Differentiable Construction of Molecular Mechanics Force Fields."](https://arxiv.org/abs/2010.01196)

![abstract](docs/_static/espaloma_abstract_v2-2.png)

#
Documentation: https://docs.espaloma.org

# Paper Abstract
Molecular mechanics (MM) potentials have long been a workhorse of computational chemistry.
Leveraging accuracy and speed, these functional forms find use in a wide variety of applications in biomolecular modeling and drug discovery, from rapid virtual screening to detailed free energy calculations.
Traditionally, MM potentials have relied on human-curated, inflexible, and poorly extensible discrete chemical perception rules _atom types_ for applying parameters to small molecules or biopolymers, making it difficult to optimize both types and parameters to fit quantum chemical or physical property data.
Here, we propose an alternative approach that uses _graph neural networks_ to perceive chemical environments, producing continuous atom embeddings from which valence and nonbonded parameters can be predicted using invariance-preserving layers.
Since all stages are built from smooth neural functions, the entire process---spanning chemical perception to parameter assignment---is modular and end-to-end differentiable with respect to model parameters, allowing new force fields to be easily constructed, extended, and applied to arbitrary molecules.
We show that this approach is not only sufficiently expressive to reproduce legacy atom types, but that it can learn and extend existing molecular mechanics force fields, construct entirely new force fields applicable to both biopolymers and small molecules from quantum chemical calculations, and even learn to accurately predict free energies from experimental observables.


# Installation

We recommend using [`mamba`](https://mamba.readthedocs.io/en/latest/mamba-installation.html#mamba-installation) which is a drop-in replacement for `conda` and is much faster.   

```bash
$ mamba create --name espaloma -c conda-forge "espaloma=0.3.2"
```

# Example: Deploy espaloma 0.3.2 pretrained force field to arbitrary MM system

```python  
# imports
import os
import torch
import espaloma as esp

# define or load a molecule of interest via the Open Force Field toolkit
from openff.toolkit.topology import Molecule
molecule = Molecule.from_smiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")

# create an Espaloma Graph object to represent the molecule of interest
molecule_graph = esp.Graph(molecule)

# load pretrained model
espaloma_model = esp.get_model("latest")

# apply a trained espaloma model to assign parameters
espaloma_model(molecule_graph.heterograph)

# create an OpenMM System for the specified molecule
openmm_system = esp.graphs.deploy.openmm_system_from_graph(molecule_graph)
```

If using espaloma from a local `.pt` file, say for example `espaloma-0.3.2.pt`,
then you would need to run the `eval` method of the model to get the correct
inference/predictions, as follows:

```python
import torch
...
# load local pretrained model
espaloma_model = torch.load("espaloma-0.3.2.pt")
espaloma_model.eval()
...
```

The rest of the code should be the same as in the previous code block example.

# Compatible models

Below is a compatibility matrix for different versions of `espaloma` code and `espaloma` models (the `.pt` file).

| Model 🧪             | DOI 📝 | Supported Espaloma version 💻 | Release Date 🗓️ | Espaloma architecture change 📐? |
|---------------------|-------|------------------------------|----------------|----------------------------------|
| `espaloma-0.3.2.pt` |       | 0.3.1, 0.3.2, 0.4.0          | Sep 22, 2023   | ✅ No                            |
| `espaloma-0.3.1.pt` |       | 0.3.1, 0.3.2, 0.4.0          | Jul 17, 2023   | ⚠️ Yes                           |
| `espaloma-0.3.0.pt` |       | 0.3.0                        | Apr 26, 2023   | ⚠️Yes                            |

> [!NOTE]  
> `espaloma-0.3.1.pt` and `espaloma-0.3.2.pt` are the same model.

# Using espaloma to parameterize small molecules in relative free energy calculations

An example of using espaloma to parameterize small molecules in relative alchemical free energy calculations is provided in the `scripts/perses-benchmark/` directory.

# Manifest

* `espaloma/` core code for graph-parametrized potential energy functions.
    * `graphs/` data objects that contain various level of information we need.
        * `graph.py` base modules for graphs.
        * `molecule_graph.py` provide APIs to various molecular modelling toolkits.
        * `homogeneous_graph.py` simplest graph representation of a molecule.
        * `heterogeneous_graph.py` graph representation of a molecule that contains information regarding membership of lower-level nodes to higher-level nodes.
        * `parametrized_graph.py` graph representation of a molecule with all parameters needed for energy evaluation.
    * `nn/` neural network models that facilitates translation between graphs.
        * `dgl_legacy.py` API to dgl models for atom-level message passing.
    * `mm/` molecular mechanics functionalities for energy evaluation.
        * `i/` energy terms used in Class-I force field.
            * `bond.py` bond energy
            * `angle.py` angle energy
            * `torsion.py` torsion energy
            * `nonbonded.py` nonbonded energy
        * `ii/` energy terms used in Class-II force field.
            * `coupling.py` coupling terms
            * `polynomial.py` higher order polynomials.

# License

This software is licensed under [MIT license](https://opensource.org/licenses/MIT).

# Copyright

Copyright (c) 2020, Chodera Lab at Memorial Sloan Kettering Cancer Center and Authors:
Authors:
- [Yuanqing Wang](http://www.wangyq.net)
- Josh Fass
- John D. Chodera


================================================
FILE: devtools/README.md
================================================
# Development, testing, and deployment tools

This directory contains a collection of tools for running Continuous Integration (CI) tests, 
conda installation, and other development tools not directly related to the coding process.


## Manifest

### Continuous Integration

You should test your code, but do not feel compelled to use these specific programs. You also may not need Unix and 
Windows testing if you only plan to deploy on specific platforms. These are just to help you get started

* `travis-ci`: Linux and OSX based testing through [Travis-CI](https://about.travis-ci.com/) 
  * `before_install.sh`: Pip/Miniconda pre-package installation script for Travis 
* `appveyor`: Windows based testing through [AppVeyor](https://www.appveyor.com/) (there are no files directly related to this)

### Conda Environment:

This directory contains the files to setup the Conda environment for testing purposes

* `conda-envs`: directory containing the YAML file(s) which fully describe Conda Environments, their dependencies, and those dependency provenance's
  * `test_env.yaml`: Simple test environment file with base dependencies. Channels are not specified here and therefore respect global Conda configuration
  
### Additional Scripts:

This directory contains OS agnostic helper scripts which don't fall in any of the previous categories
* `scripts`
  * `create_conda_env.py`: Helper program for spinning up new conda environments based on a starter file with Python Version and Env. Name command-line options


## How to contribute changes
- Clone the repository if you have write access to the main repo, fork the repository if you are a collaborator.
- Make a new branch with `git checkout -b {your branch name}`
- Make changes and test your code
- Ensure that the test environment dependencies (`conda-envs`) line up with the build and deploy dependencies (`conda-recipe/meta.yaml`)
- Push the branch to the repo (either the main or your fork) with `git push -u origin {your branch name}`
  * Note that `origin` is the default name assigned to the remote, yours may be different
- Make a PR on GitHub with your changes
- We'll review the changes and get your code into the repo after lively discussion!


## Checklist for updates
- [ ] Make sure there is an/are issue(s) opened for your specific update
- [ ] Create the PR, referencing the issue
- [ ] Debug the PR as needed until tests pass
- [ ] Tag the final, debugged version 
   *  `git tag -a X.Y.Z [latest pushed commit] && git push --follow-tags`
- [ ] Get the PR merged in

## Versioneer Auto-version
[Versioneer](https://github.com/warner/python-versioneer) will automatically infer what version 
is installed by looking at the `git` tags and how many commits ahead this version is. The format follows 
[PEP 440](https://www.python.org/dev/peps/pep-0440/) and has the regular expression of:
```regexp
\d+.\d+.\d+(?\+\d+-[a-z0-9]+)
```
If the version of this commit is the same as a `git` tag, the installed version is the same as the tag, 
e.g. `espaloma-0.1.2`, otherwise it will be appended with `+X` where `X` is the number of commits 
ahead from the last tag, and then `-YYYYYY` where the `Y`'s are replaced with the `git` commit hash.


================================================
FILE: devtools/conda-envs/espaloma.yaml
================================================
name: espaloma-test
channels:
  - conda-forge
  - openeye
dependencies:
  # Base dependencies
  - python
  - pip
  # 3rd party
  - openeye-toolkits
  - numpy
  - matplotlib
  - scipy
  - openff-toolkit >=0.12
  - openff-forcefields
  - openff-units
  - smirnoff99frosst>=1.1.0.1  #https://github.com/openforcefield/smirnoff99Frosst/issues/109
  - openmm
  - openmmforcefields >=0.11.2
  - tqdm
  - pydantic <2  # We need our deps to fix this
  - qcportal >=0.50
  - dgl =2.3.0
  - torchdata <= 0.10.0
  # Testing
  - pytest
  - pytest-cov
  - pytest-xdist
  - pytest-randomly
  - codecov
  - nose
  - nose-timer
  - coverage
  - sphinx
  - sphinx_rtd_theme


================================================
FILE: devtools/conda-recipe/build.sh
================================================
pip install .


================================================
FILE: devtools/conda-recipe/meta.yml
================================================
package:
  name: espaloma
  version: !!str 0.0.0

source:
  path: ../../

build:
  preserve_egg_dir: True
  number: 0

requirements:
  build:
    - python
    - setuptools
    - numpy >=1.14

  run:
    - python
    - pip
    - openeye-toolkits
    - numpy
    - matplotlib
    - scipy
    - openff-toolkit
    - openff-forcefields
    - smirnoff99Frosst
    - openmm
    - openmmforcefields
    - pytorch
    - dgl
    - pytest
    - pytest-cov
    - codecov
    - nose
    - nose-timer
    - coverage
    - qcportal
    - torchdata <= 0.10.0

about:
  home: https://github.com/choderalab/perses
  license: MIT
  license_file: LICENSE


================================================
FILE: devtools/gh-actions/initialize_conda.sh
================================================
case $CI_OS in
    windows*)
        eval "$(${CONDA}/condabin/conda.bat shell.bash hook)";;
    *)
        eval "$(${CONDA}/condabin/conda shell.bash hook)";;
esac

================================================
FILE: devtools/scripts/create_conda_env.py
================================================
import argparse
import glob
import os
import re
import shutil
import subprocess as sp
from contextlib import contextmanager
from tempfile import TemporaryDirectory

# YAML imports
try:
    import yaml  # PyYAML
    loader = yaml.load
except ImportError:
    try:
        import ruamel_yaml as yaml  # Ruamel YAML
    except ImportError:
        try:
            # Load Ruamel YAML from the base conda environment
            from importlib import util as import_util
            CONDA_BIN = os.path.dirname(os.environ['CONDA_EXE'])
            ruamel_yaml_path = glob.glob(os.path.join(CONDA_BIN, '..',
                                                      'lib', 'python*.*', 'site-packages',
                                                      'ruamel_yaml', '__init__.py'))[0]
            # Based on importlib example, but only needs to load_module since its the whole package, not just
            # a module
            spec = import_util.spec_from_file_location('ruamel_yaml', ruamel_yaml_path)
            yaml = spec.loader.load_module()
        except (KeyError, ImportError, IndexError):
            raise ImportError("No YAML parser could be found in this or the conda environment. "
                              "Could not find PyYAML or Ruamel YAML in the current environment, "
                              "AND could not find Ruamel YAML in the base conda environment through CONDA_EXE path. " 
                              "Environment not created!")
    loader = yaml.YAML(typ="safe").load  # typ="safe" avoids odd typing on output


@contextmanager
def temp_cd():
    """Temporary CD Helper"""
    cwd = os.getcwd()
    with TemporaryDirectory() as td:
        try:
            os.chdir(td)
            yield
        finally:
            os.chdir(cwd)


# Args
parser = argparse.ArgumentParser(description='Creates a conda environment from file for a given Python version.')
parser.add_argument('-n', '--name', type=str,
                    help='The name of the created Python environment')
parser.add_argument('-p', '--python', type=str,
                    help='The version of the created Python environment')
parser.add_argument('conda_file',
                    help='The file for the created Python environment')

args = parser.parse_args()

# Open the base file
with open(args.conda_file, "r") as handle:
    yaml_script = loader(handle.read())

python_replacement_string = "python {}*".format(args.python)

try:
    for dep_index, dep_value in enumerate(yaml_script['dependencies']):
        if re.match('python([ ><=*]+[0-9.*]*)?$', dep_value):  # Match explicitly 'python' and its formats
            yaml_script['dependencies'].pop(dep_index)
            break  # Making the assumption there is only one Python entry, also avoids need to enumerate in reverse
except (KeyError, TypeError):
    # Case of no dependencies key, or dependencies: None
    yaml_script['dependencies'] = []
finally:
    # Ensure the python version is added in. Even if the code does not need it, we assume the env does
    yaml_script['dependencies'].insert(0, python_replacement_string)

# Figure out conda path
if "CONDA_EXE" in os.environ:
    conda_path = os.environ["CONDA_EXE"]
else:
    conda_path = shutil.which("conda")
if conda_path is None:
    raise RuntimeError("Could not find a conda binary in CONDA_EXE variable or in executable search path")

print("CONDA ENV NAME  {}".format(args.name))
print("PYTHON VERSION  {}".format(args.python))
print("CONDA FILE NAME {}".format(args.conda_file))
print("CONDA PATH      {}".format(conda_path))

# Write to a temp directory which will always be cleaned up
with temp_cd():
    temp_file_name = "temp_script.yaml"
    with open(temp_file_name, 'w') as f:
        f.write(yaml.dump(yaml_script))
    sp.call("{} env create -n {} -f {}".format(conda_path, args.name, temp_file_name), shell=True)


================================================
FILE: docker/Dockerfile
================================================
FROM mambaorg/micromamba:1.4.9

LABEL org.opencontainers.image.source=https://github.com/choderalab/espaloma
LABEL org.opencontainers.image.description="Extensible Surrogate Potential of Ab initio Learned and Optimized by Message-passing Algorithm"
LABEL org.opencontainers.image.licenses=MIT
# OpenFE Version we want to build
ARG VERSION

# Don't buffer stdout & stderr streams, so if there is a crash no partial buffer output is lost
# https://docs.python.org/3/using/cmdline.html#cmdoption-u
ENV PYTHONUNBUFFERED=1

RUN micromamba install -y -n base -c conda-forge -c dglteam pytest "dgl<1" git "espaloma==$VERSION" && \
    micromamba clean --all --yes

# Ensure that conda environment is automatically activated
# https://github.com/mamba-org/micromamba-docker#running-commands-in-dockerfile-within-the-conda-environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1


================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = espaloma
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

================================================
FILE: docs/README.md
================================================
# Compiling espaloma's Documentation

The docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/master/).
To compile the docs, first ensure that Sphinx and the ReadTheDocs theme are installed.


```bash
conda install sphinx sphinx_rtd_theme 
```


Once installed, you can use the `Makefile` in this directory to compile static HTML pages by
```bash
make html
```

The compiled docs will be in the `_build` directory and can be viewed by opening `index.html` (which may itself 
be inside a directory called `html/` depending on what version of Sphinx is installed).

================================================
FILE: docs/_static/README.md
================================================
# Static Doc Directory

Add any paths that contain custom static files (such as style sheets) here,
relative to the `conf.py` file's directory. 
They are copied after the builtin static files,
so a file named "default.css" will overwrite the builtin "default.css".

The path to this folder is set in the Sphinx `conf.py` file in the line: 
```python
templates_path = ['_static']
```

## Examples of file to add to this directory
* Custom Cascading Style Sheets
* Custom JavaScript code
* Static logo images


================================================
FILE: docs/_templates/README.md
================================================
# Templates Doc Directory

Add any paths that contain templates here, relative to  
the `conf.py` file's directory.
They are copied after the builtin template files,
so a file named "page.html" will overwrite the builtin "page.html".

The path to this folder is set in the Sphinx `conf.py` file in the line: 
```python
html_static_path = ['_templates']
```

## Examples of file to add to this directory
* HTML extensions of stock pages like `page.html` or `layout.html`


================================================
FILE: docs/_templates/custom-class-template.rst
================================================
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
   :members:
   :show-inheritance:
   :inherited-members:

   {% block methods %}
   .. automethod:: __init__

   {% if methods %}
   .. rubric:: {{ _('Methods') }}

   .. autosummary::
   {% for item in methods %}
      ~{{ name }}.{{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block attributes %}
   {% if attributes %}
   .. rubric:: {{ _('Attributes') }}

   .. autosummary::
   {% for item in attributes %}
      ~{{ name }}.{{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}


================================================
FILE: docs/_templates/custom-module-template.rst
================================================
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}
  
   {% block attributes %}
   {% if attributes %}
   .. rubric:: Module Attributes

   .. autosummary::
      :toctree:
   {% for item in attributes %}
      {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block functions %}
   {% if functions %}
   .. rubric:: {{ _('Functions') }}

   .. autosummary::
      :toctree:
   {% for item in functions %}
      {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block classes %}
   {% if classes %}
   .. rubric:: {{ _('Classes') }}

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   {% for item in classes %}
      {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block exceptions %}
   {% if exceptions %}
   .. rubric:: {{ _('Exceptions') }}

   .. autosummary::
      :toctree:
   {% for item in exceptions %}
      {{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:

{% for item in modules %}
   {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}


================================================
FILE: docs/api.rst
================================================
API Documentation
=================

.. autosummary::
   :toctree: autosummary
   :template: custom-module-template.rst
   :recursive:

   espaloma.mm
   espaloma.nn
   espaloma.graphs
   espaloma.data 


================================================
FILE: docs/autosummary/espaloma.data.collection.alkethoh.rst
================================================
espaloma.data.collection.alkethoh
=================================

.. currentmodule:: espaloma.data.collection

.. autofunction:: alkethoh

================================================
FILE: docs/autosummary/espaloma.data.collection.esol.rst
================================================
espaloma.data.collection.esol
=============================

.. currentmodule:: espaloma.data.collection

.. autofunction:: esol

================================================
FILE: docs/autosummary/espaloma.data.collection.md17_new.rst
================================================
espaloma.data.collection.md17\_new
==================================

.. currentmodule:: espaloma.data.collection

.. autofunction:: md17_new

================================================
FILE: docs/autosummary/espaloma.data.collection.md17_old.rst
================================================
espaloma.data.collection.md17\_old
==================================

.. currentmodule:: espaloma.data.collection

.. autofunction:: md17_old

================================================
FILE: docs/autosummary/espaloma.data.collection.qca.rst
================================================
espaloma.data.collection.qca
============================

.. currentmodule:: espaloma.data.collection

.. autoclass:: qca
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~qca.__init__
      ~qca.bayer
      ~qca.benchmark
      ~qca.coverage
      ~qca.emolecules
      ~qca.fda
      ~qca.pfizer
      ~qca.roche
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.collection.rst
================================================
espaloma.data.collection
========================

.. automodule:: espaloma.data.collection
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      alkethoh
      esol
      md17_new
      md17_old
      zinc
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      qca
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.collection.zinc.rst
================================================
espaloma.data.collection.zinc
=============================

.. currentmodule:: espaloma.data.collection

.. autofunction:: zinc

================================================
FILE: docs/autosummary/espaloma.data.dataset.Dataset.rst
================================================
espaloma.data.dataset.Dataset
=============================

.. currentmodule:: espaloma.data.dataset

.. autoclass:: Dataset
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~Dataset.__init__
      ~Dataset.apply
      ~Dataset.load
      ~Dataset.save
      ~Dataset.shuffle
      ~Dataset.split
      ~Dataset.subsample
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.dataset.GraphDataset.rst
================================================
espaloma.data.dataset.GraphDataset
==================================

.. currentmodule:: espaloma.data.dataset

.. autoclass:: GraphDataset
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~GraphDataset.__init__
      ~GraphDataset.apply
      ~GraphDataset.batch
      ~GraphDataset.load
      ~GraphDataset.save
      ~GraphDataset.shuffle
      ~GraphDataset.split
      ~GraphDataset.subsample
      ~GraphDataset.view
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.dataset.rst
================================================
espaloma.data.dataset
=====================

.. automodule:: espaloma.data.dataset
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      Dataset
      GraphDataset
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.md.MoleculeVacuumSimulation.rst
================================================
espaloma.data.md.MoleculeVacuumSimulation
=========================================

.. currentmodule:: espaloma.data.md

.. autoclass:: MoleculeVacuumSimulation
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~MoleculeVacuumSimulation.__init__
      ~MoleculeVacuumSimulation.run
      ~MoleculeVacuumSimulation.simulation_from_graph
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.md.rst
================================================
espaloma.data.md
================

.. automodule:: espaloma.data.md
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      subtract_nonbonded_force
      subtract_nonbonded_force_except_14
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      MoleculeVacuumSimulation
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.md.subtract_nonbonded_force.rst
================================================
espaloma.data.md.subtract\_nonbonded\_force
===========================================

.. currentmodule:: espaloma.data.md

.. autofunction:: subtract_nonbonded_force

================================================
FILE: docs/autosummary/espaloma.data.md.subtract_nonbonded_force_except_14.rst
================================================
espaloma.data.md.subtract\_nonbonded\_force\_except\_14
=======================================================

.. currentmodule:: espaloma.data.md

.. autofunction:: subtract_nonbonded_force_except_14

================================================
FILE: docs/autosummary/espaloma.data.md17_utils.get_molecule.rst
================================================
espaloma.data.md17\_utils.get\_molecule
=======================================

.. currentmodule:: espaloma.data.md17_utils

.. autofunction:: get_molecule

================================================
FILE: docs/autosummary/espaloma.data.md17_utils.realize_molecule.rst
================================================
espaloma.data.md17\_utils.realize\_molecule
===========================================

.. currentmodule:: espaloma.data.md17_utils

.. autofunction:: realize_molecule

================================================
FILE: docs/autosummary/espaloma.data.md17_utils.rst
================================================
espaloma.data.md17\_utils
=========================

.. automodule:: espaloma.data.md17_utils
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      get_molecule
      realize_molecule
      sum_offsets
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.md17_utils.sum_offsets.rst
================================================
espaloma.data.md17\_utils.sum\_offsets
======================================

.. currentmodule:: espaloma.data.md17_utils

.. autofunction:: sum_offsets

================================================
FILE: docs/autosummary/espaloma.data.normalize.BaseNormalize.rst
================================================
espaloma.data.normalize.BaseNormalize
=====================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: BaseNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~BaseNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.DatasetLogNormalNormalize.rst
================================================
espaloma.data.normalize.DatasetLogNormalNormalize
=================================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: DatasetLogNormalNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~DatasetLogNormalNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.DatasetNormalNormalize.rst
================================================
espaloma.data.normalize.DatasetNormalNormalize
==============================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: DatasetNormalNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~DatasetNormalNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.ESOL100LogNormalNormalize.rst
================================================
espaloma.data.normalize.ESOL100LogNormalNormalize
=================================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: ESOL100LogNormalNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~ESOL100LogNormalNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.ESOL100NormalNormalize.rst
================================================
espaloma.data.normalize.ESOL100NormalNormalize
==============================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: ESOL100NormalNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~ESOL100NormalNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.NotNormalize.rst
================================================
espaloma.data.normalize.NotNormalize
====================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: NotNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~NotNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.PositiveNotNormalize.rst
================================================
espaloma.data.normalize.PositiveNotNormalize
============================================

.. currentmodule:: espaloma.data.normalize

.. autoclass:: PositiveNotNormalize
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~PositiveNotNormalize.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.data.normalize.rst
================================================
espaloma.data.normalize
=======================

.. automodule:: espaloma.data.normalize
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      BaseNormalize
      DatasetLogNormalNormalize
      DatasetNormalNormalize
      ESOL100LogNormalNormalize
      ESOL100NormalNormalize
      NotNormalize
      PositiveNotNormalize
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.MolWithTargets.rst
================================================
espaloma.data.qcarchive\_utils.MolWithTargets
=============================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autoclass:: MolWithTargets
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~MolWithTargets.__init__
      ~MolWithTargets.count
      ~MolWithTargets.index
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~MolWithTargets.energies
      ~MolWithTargets.gradients
      ~MolWithTargets.offmol
      ~MolWithTargets.xyz
   
   

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.breakdown_along_time_axis.rst
================================================
espaloma.data.qcarchive\_utils.breakdown\_along\_time\_axis
===========================================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: breakdown_along_time_axis

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.fetch_td_record.rst
================================================
espaloma.data.qcarchive\_utils.fetch\_td\_record
================================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: fetch_td_record

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.get_client.rst
================================================
espaloma.data.qcarchive\_utils.get\_client
==========================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: get_client

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.get_collection.rst
================================================
espaloma.data.qcarchive\_utils.get\_collection
==============================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: get_collection

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.get_energy_and_gradient.rst
================================================
espaloma.data.qcarchive\_utils.get\_energy\_and\_gradient
=========================================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: get_energy_and_gradient

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.get_graph.rst
================================================
espaloma.data.qcarchive\_utils.get\_graph
=========================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: get_graph

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.h5_to_dataset.rst
================================================
espaloma.data.qcarchive\_utils.h5\_to\_dataset
==============================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: h5_to_dataset

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.make_batch_size_consistent.rst
================================================
espaloma.data.qcarchive\_utils.make\_batch\_size\_consistent
============================================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: make_batch_size_consistent

================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.rst
================================================
espaloma.data.qcarchive\_utils
==============================

.. automodule:: espaloma.data.qcarchive_utils
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      breakdown_along_time_axis
      fetch_td_record
      get_client
      get_collection
      get_energy_and_gradient
      get_graph
      h5_to_dataset
      make_batch_size_consistent
      weight_by_snapshots
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      MolWithTargets
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.qcarchive_utils.weight_by_snapshots.rst
================================================
espaloma.data.qcarchive\_utils.weight\_by\_snapshots
====================================================

.. currentmodule:: espaloma.data.qcarchive_utils

.. autofunction:: weight_by_snapshots

================================================
FILE: docs/autosummary/espaloma.data.rst
================================================
espaloma.data
=============

.. automodule:: espaloma.data
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.data.collection
   espaloma.data.dataset
   espaloma.data.md
   espaloma.data.md17_utils
   espaloma.data.normalize
   espaloma.data.qcarchive_utils
   espaloma.data.utils



================================================
FILE: docs/autosummary/espaloma.data.utils.batch.rst
================================================
espaloma.data.utils.batch
=========================

.. currentmodule:: espaloma.data.utils

.. autofunction:: batch

================================================
FILE: docs/autosummary/espaloma.data.utils.collate_fn.rst
================================================
espaloma.data.utils.collate\_fn
===============================

.. currentmodule:: espaloma.data.utils

.. autofunction:: collate_fn

================================================
FILE: docs/autosummary/espaloma.data.utils.from_csv.rst
================================================
espaloma.data.utils.from\_csv
=============================

.. currentmodule:: espaloma.data.utils

.. autofunction:: from_csv

================================================
FILE: docs/autosummary/espaloma.data.utils.infer_mol_from_coordinates.rst
================================================
espaloma.data.utils.infer\_mol\_from\_coordinates
=================================================

.. currentmodule:: espaloma.data.utils

.. autofunction:: infer_mol_from_coordinates

================================================
FILE: docs/autosummary/espaloma.data.utils.make_temp_directory.rst
================================================
espaloma.data.utils.make\_temp\_directory
=========================================

.. currentmodule:: espaloma.data.utils

.. autofunction:: make_temp_directory

================================================
FILE: docs/autosummary/espaloma.data.utils.normalize.rst
================================================
espaloma.data.utils.normalize
=============================

.. currentmodule:: espaloma.data.utils

.. autofunction:: normalize

================================================
FILE: docs/autosummary/espaloma.data.utils.rst
================================================
espaloma.data.utils
===================

.. automodule:: espaloma.data.utils
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      batch
      collate_fn
      from_csv
      infer_mol_from_coordinates
      make_temp_directory
      normalize
      split
      sum_offsets
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.data.utils.split.rst
================================================
espaloma.data.utils.split
=========================

.. currentmodule:: espaloma.data.utils

.. autofunction:: split

================================================
FILE: docs/autosummary/espaloma.data.utils.sum_offsets.rst
================================================
espaloma.data.utils.sum\_offsets
================================

.. currentmodule:: espaloma.data.utils

.. autofunction:: sum_offsets

================================================
FILE: docs/autosummary/espaloma.graphs.deploy.load_forcefield.rst
================================================
espaloma.graphs.deploy.load\_forcefield
=======================================

.. currentmodule:: espaloma.graphs.deploy

.. autofunction:: load_forcefield

================================================
FILE: docs/autosummary/espaloma.graphs.deploy.openmm_system_from_graph.rst
================================================
espaloma.graphs.deploy.openmm\_system\_from\_graph
==================================================

.. currentmodule:: espaloma.graphs.deploy

.. autofunction:: openmm_system_from_graph

================================================
FILE: docs/autosummary/espaloma.graphs.deploy.rst
================================================
espaloma.graphs.deploy
======================

.. automodule:: espaloma.graphs.deploy
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      load_forcefield
      openmm_system_from_graph
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.graph.BaseGraph.rst
================================================
espaloma.graphs.graph.BaseGraph
===============================

.. currentmodule:: espaloma.graphs.graph

.. autoclass:: BaseGraph
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~BaseGraph.__init__
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.graphs.graph.Graph.rst
================================================
espaloma.graphs.graph.Graph
===========================

.. currentmodule:: espaloma.graphs.graph

.. autoclass:: Graph
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~Graph.__init__
      ~Graph.get_heterograph_from_graph_and_mol
      ~Graph.get_homograph_from_mol
      ~Graph.load
      ~Graph.save
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~Graph.edata
      ~Graph.ndata
      ~Graph.nodes
   
   

================================================
FILE: docs/autosummary/espaloma.graphs.graph.rst
================================================
espaloma.graphs.graph
=====================

.. automodule:: espaloma.graphs.graph
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      BaseGraph
      Graph
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.legacy_force_field.LegacyForceField.rst
================================================
espaloma.graphs.legacy\_force\_field.LegacyForceField
=====================================================

.. currentmodule:: espaloma.graphs.legacy_force_field

.. autoclass:: LegacyForceField
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~LegacyForceField.__init__
      ~LegacyForceField.baseline_energy
      ~LegacyForceField.multi_typing
      ~LegacyForceField.parametrize
      ~LegacyForceField.typing
   
   

   
   
   

================================================
FILE: docs/autosummary/espaloma.graphs.legacy_force_field.rst
================================================
espaloma.graphs.legacy\_force\_field
====================================

.. automodule:: espaloma.graphs.legacy_force_field
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      LegacyForceField
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.rst
================================================
espaloma.graphs
===============

.. automodule:: espaloma.graphs
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.graphs.deploy
   espaloma.graphs.graph
   espaloma.graphs.legacy_force_field
   espaloma.graphs.utils



================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.angle_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices.angle\_indices
====================================================

.. currentmodule:: espaloma.graphs.utils.offmol_indices

.. autofunction:: angle_indices

================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.atom_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices.atom\_indices
===================================================

.. currentmodule:: espaloma.graphs.utils.offmol_indices

.. autofunction:: atom_indices

================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.bond_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices.bond\_indices
===================================================

.. currentmodule:: espaloma.graphs.utils.offmol_indices

.. autofunction:: bond_indices

================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.improper_torsion_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices.improper\_torsion\_indices
================================================================

.. currentmodule:: espaloma.graphs.utils.offmol_indices

.. autofunction:: improper_torsion_indices

================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.proper_torsion_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices.proper\_torsion\_indices
==============================================================

.. currentmodule:: espaloma.graphs.utils.offmol_indices

.. autofunction:: proper_torsion_indices

================================================
FILE: docs/autosummary/espaloma.graphs.utils.offmol_indices.rst
================================================
espaloma.graphs.utils.offmol\_indices
=====================================

.. automodule:: espaloma.graphs.utils.offmol_indices
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      angle_indices
      atom_indices
      bond_indices
      improper_torsion_indices
      proper_torsion_indices
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.duplicate_index_ordering.rst
================================================
espaloma.graphs.utils.read\_heterogeneous\_graph.duplicate\_index\_ordering
===========================================================================

.. currentmodule:: espaloma.graphs.utils.read_heterogeneous_graph

.. autofunction:: duplicate_index_ordering

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.from_homogeneous_and_mol.rst
================================================
espaloma.graphs.utils.read\_heterogeneous\_graph.from\_homogeneous\_and\_mol
============================================================================

.. currentmodule:: espaloma.graphs.utils.read_heterogeneous_graph

.. autofunction:: from_homogeneous_and_mol

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.relationship_indices_from_offmol.rst
================================================
espaloma.graphs.utils.read\_heterogeneous\_graph.relationship\_indices\_from\_offmol
====================================================================================

.. currentmodule:: espaloma.graphs.utils.read_heterogeneous_graph

.. autofunction:: relationship_indices_from_offmol

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.rst
================================================
espaloma.graphs.utils.read\_heterogeneous\_graph
================================================

.. automodule:: espaloma.graphs.utils.read_heterogeneous_graph
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      duplicate_index_ordering
      from_homogeneous_and_mol
      relationship_indices_from_offmol
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.fp_oe.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph.fp\_oe
=====================================================

.. currentmodule:: espaloma.graphs.utils.read_homogeneous_graph

.. autofunction:: fp_oe

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.fp_rdkit.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph.fp\_rdkit
========================================================

.. currentmodule:: espaloma.graphs.utils.read_homogeneous_graph

.. autofunction:: fp_rdkit

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_oemol.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph.from\_oemol
==========================================================

.. currentmodule:: espaloma.graphs.utils.read_homogeneous_graph

.. autofunction:: from_oemol

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_openff_toolkit_mol.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph.from\_openff\_toolkit\_mol
=========================================================================

.. currentmodule:: espaloma.graphs.utils.read_homogeneous_graph

.. autofunction:: from_openff_toolkit_mol

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_rdkit_mol.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph.from\_rdkit\_mol
===============================================================

.. currentmodule:: espaloma.graphs.utils.read_homogeneous_graph

.. autofunction:: from_rdkit_mol

================================================
FILE: docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.rst
================================================
espaloma.graphs.utils.read\_homogeneous\_graph
==============================================

.. automodule:: espaloma.graphs.utils.read_homogeneous_graph
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      fp_oe
      fp_rdkit
      from_oemol
      from_openff_toolkit_mol
      from_rdkit_mol
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.graphs.utils.rst
================================================
espaloma.graphs.utils
=====================

.. automodule:: espaloma.graphs.utils
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.graphs.utils.offmol_indices
   espaloma.graphs.utils.read_heterogeneous_graph
   espaloma.graphs.utils.read_homogeneous_graph



================================================
FILE: docs/autosummary/espaloma.mm.angle.angle_high.rst
================================================
espaloma.mm.angle.angle\_high
=============================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: angle_high

================================================
FILE: docs/autosummary/espaloma.mm.angle.bond_angle.rst
================================================
espaloma.mm.angle.bond\_angle
=============================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: bond_angle

================================================
FILE: docs/autosummary/espaloma.mm.angle.bond_bond.rst
================================================
espaloma.mm.angle.bond\_bond
============================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: bond_bond

================================================
FILE: docs/autosummary/espaloma.mm.angle.harmonic_angle.rst
================================================
espaloma.mm.angle.harmonic\_angle
=================================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: harmonic_angle

================================================
FILE: docs/autosummary/espaloma.mm.angle.linear_mixture_angle.rst
================================================
espaloma.mm.angle.linear\_mixture\_angle
========================================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: linear_mixture_angle

================================================
FILE: docs/autosummary/espaloma.mm.angle.rst
================================================
espaloma.mm.angle
=================

.. automodule:: espaloma.mm.angle
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      angle_high
      bond_angle
      bond_bond
      harmonic_angle
      linear_mixture_angle
      urey_bradley
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.angle.urey_bradley.rst
================================================
espaloma.mm.angle.urey\_bradley
===============================

.. currentmodule:: espaloma.mm.angle

.. autofunction:: urey_bradley

================================================
FILE: docs/autosummary/espaloma.mm.bond.bond_high.rst
================================================
espaloma.mm.bond.bond\_high
===========================

.. currentmodule:: espaloma.mm.bond

.. autofunction:: bond_high

================================================
FILE: docs/autosummary/espaloma.mm.bond.gaussian_bond.rst
================================================
espaloma.mm.bond.gaussian\_bond
===============================

.. currentmodule:: espaloma.mm.bond

.. autofunction:: gaussian_bond

================================================
FILE: docs/autosummary/espaloma.mm.bond.harmonic_bond.rst
================================================
espaloma.mm.bond.harmonic\_bond
===============================

.. currentmodule:: espaloma.mm.bond

.. autofunction:: harmonic_bond

================================================
FILE: docs/autosummary/espaloma.mm.bond.linear_mixture_bond.rst
================================================
espaloma.mm.bond.linear\_mixture\_bond
======================================

.. currentmodule:: espaloma.mm.bond

.. autofunction:: linear_mixture_bond

================================================
FILE: docs/autosummary/espaloma.mm.bond.rst
================================================
espaloma.mm.bond
================

.. automodule:: espaloma.mm.bond
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      bond_high
      gaussian_bond
      harmonic_bond
      linear_mixture_bond
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.energy.CarryII.rst
================================================
espaloma.mm.energy.CarryII
==========================

.. currentmodule:: espaloma.mm.energy

.. autoclass:: CarryII
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~CarryII.__init__
      ~CarryII.add_module
      ~CarryII.apply
      ~CarryII.bfloat16
      ~CarryII.buffers
      ~CarryII.children
      ~CarryII.cpu
      ~CarryII.cuda
      ~CarryII.double
      ~CarryII.eval
      ~CarryII.extra_repr
      ~CarryII.float
      ~CarryII.forward
      ~CarryII.half
      ~CarryII.load_state_dict
      ~CarryII.modules
      ~CarryII.named_buffers
      ~CarryII.named_children
      ~CarryII.named_modules
      ~CarryII.named_parameters
      ~CarryII.parameters
      ~CarryII.register_backward_hook
      ~CarryII.register_buffer
      ~CarryII.register_forward_hook
      ~CarryII.register_forward_pre_hook
      ~CarryII.register_parameter
      ~CarryII.requires_grad_
      ~CarryII.share_memory
      ~CarryII.state_dict
      ~CarryII.to
      ~CarryII.train
      ~CarryII.type
      ~CarryII.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~CarryII.T_destination
      ~CarryII.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.mm.energy.EnergyInGraph.rst
================================================
espaloma.mm.energy.EnergyInGraph
================================

.. currentmodule:: espaloma.mm.energy

.. autoclass:: EnergyInGraph
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~EnergyInGraph.__init__
      ~EnergyInGraph.add_module
      ~EnergyInGraph.apply
      ~EnergyInGraph.bfloat16
      ~EnergyInGraph.buffers
      ~EnergyInGraph.children
      ~EnergyInGraph.cpu
      ~EnergyInGraph.cuda
      ~EnergyInGraph.double
      ~EnergyInGraph.eval
      ~EnergyInGraph.extra_repr
      ~EnergyInGraph.float
      ~EnergyInGraph.forward
      ~EnergyInGraph.half
      ~EnergyInGraph.load_state_dict
      ~EnergyInGraph.modules
      ~EnergyInGraph.named_buffers
      ~EnergyInGraph.named_children
      ~EnergyInGraph.named_modules
      ~EnergyInGraph.named_parameters
      ~EnergyInGraph.parameters
      ~EnergyInGraph.register_backward_hook
      ~EnergyInGraph.register_buffer
      ~EnergyInGraph.register_forward_hook
      ~EnergyInGraph.register_forward_pre_hook
      ~EnergyInGraph.register_parameter
      ~EnergyInGraph.requires_grad_
      ~EnergyInGraph.share_memory
      ~EnergyInGraph.state_dict
      ~EnergyInGraph.to
      ~EnergyInGraph.train
      ~EnergyInGraph.type
      ~EnergyInGraph.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~EnergyInGraph.T_destination
      ~EnergyInGraph.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.mm.energy.EnergyInGraphII.rst
================================================
espaloma.mm.energy.EnergyInGraphII
==================================

.. currentmodule:: espaloma.mm.energy

.. autoclass:: EnergyInGraphII
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~EnergyInGraphII.__init__
      ~EnergyInGraphII.add_module
      ~EnergyInGraphII.apply
      ~EnergyInGraphII.bfloat16
      ~EnergyInGraphII.buffers
      ~EnergyInGraphII.children
      ~EnergyInGraphII.cpu
      ~EnergyInGraphII.cuda
      ~EnergyInGraphII.double
      ~EnergyInGraphII.eval
      ~EnergyInGraphII.extra_repr
      ~EnergyInGraphII.float
      ~EnergyInGraphII.forward
      ~EnergyInGraphII.half
      ~EnergyInGraphII.load_state_dict
      ~EnergyInGraphII.modules
      ~EnergyInGraphII.named_buffers
      ~EnergyInGraphII.named_children
      ~EnergyInGraphII.named_modules
      ~EnergyInGraphII.named_parameters
      ~EnergyInGraphII.parameters
      ~EnergyInGraphII.register_backward_hook
      ~EnergyInGraphII.register_buffer
      ~EnergyInGraphII.register_forward_hook
      ~EnergyInGraphII.register_forward_pre_hook
      ~EnergyInGraphII.register_parameter
      ~EnergyInGraphII.requires_grad_
      ~EnergyInGraphII.share_memory
      ~EnergyInGraphII.state_dict
      ~EnergyInGraphII.to
      ~EnergyInGraphII.train
      ~EnergyInGraphII.type
      ~EnergyInGraphII.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~EnergyInGraphII.T_destination
      ~EnergyInGraphII.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_angle.rst
================================================
espaloma.mm.energy.apply\_angle
===============================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_angle

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_angle_ii.rst
================================================
espaloma.mm.energy.apply\_angle\_ii
===================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_angle_ii

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_angle_linear_mixture.rst
================================================
espaloma.mm.energy.apply\_angle\_linear\_mixture
================================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_angle_linear_mixture

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_bond.rst
================================================
espaloma.mm.energy.apply\_bond
==============================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_bond

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_bond_gaussian.rst
================================================
espaloma.mm.energy.apply\_bond\_gaussian
========================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_bond_gaussian

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_bond_ii.rst
================================================
espaloma.mm.energy.apply\_bond\_ii
==================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_bond_ii

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_bond_linear_mixture.rst
================================================
espaloma.mm.energy.apply\_bond\_linear\_mixture
===============================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_bond_linear_mixture

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_improper_torsion.rst
================================================
espaloma.mm.energy.apply\_improper\_torsion
===========================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_improper_torsion

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_nonbonded.rst
================================================
espaloma.mm.energy.apply\_nonbonded
===================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_nonbonded

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_torsion.rst
================================================
espaloma.mm.energy.apply\_torsion
=================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_torsion

================================================
FILE: docs/autosummary/espaloma.mm.energy.apply_torsion_ii.rst
================================================
espaloma.mm.energy.apply\_torsion\_ii
=====================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: apply_torsion_ii

================================================
FILE: docs/autosummary/espaloma.mm.energy.energy_in_graph.rst
================================================
espaloma.mm.energy.energy\_in\_graph
====================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: energy_in_graph

================================================
FILE: docs/autosummary/espaloma.mm.energy.energy_in_graph_ii.rst
================================================
espaloma.mm.energy.energy\_in\_graph\_ii
========================================

.. currentmodule:: espaloma.mm.energy

.. autofunction:: energy_in_graph_ii

================================================
FILE: docs/autosummary/espaloma.mm.energy.rst
================================================
espaloma.mm.energy
==================

.. automodule:: espaloma.mm.energy
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      apply_angle
      apply_angle_ii
      apply_angle_linear_mixture
      apply_bond
      apply_bond_gaussian
      apply_bond_ii
      apply_bond_linear_mixture
      apply_improper_torsion
      apply_nonbonded
      apply_torsion
      apply_torsion_ii
      energy_in_graph
      energy_in_graph_ii
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      CarryII
      EnergyInGraph
      EnergyInGraphII
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.functional.gaussian.rst
================================================
espaloma.mm.functional.gaussian
===============================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: gaussian

================================================
FILE: docs/autosummary/espaloma.mm.functional.harmonic.rst
================================================
espaloma.mm.functional.harmonic
===============================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: harmonic

================================================
FILE: docs/autosummary/espaloma.mm.functional.harmonic_harmonic_coupled.rst
================================================
espaloma.mm.functional.harmonic\_harmonic\_coupled
==================================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: harmonic_harmonic_coupled

================================================
FILE: docs/autosummary/espaloma.mm.functional.harmonic_harmonic_periodic_coupled.rst
================================================
espaloma.mm.functional.harmonic\_harmonic\_periodic\_coupled
============================================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: harmonic_harmonic_periodic_coupled

================================================
FILE: docs/autosummary/espaloma.mm.functional.harmonic_periodic_coupled.rst
================================================
espaloma.mm.functional.harmonic\_periodic\_coupled
==================================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: harmonic_periodic_coupled

================================================
FILE: docs/autosummary/espaloma.mm.functional.linear_mixture.rst
================================================
espaloma.mm.functional.linear\_mixture
======================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: linear_mixture

================================================
FILE: docs/autosummary/espaloma.mm.functional.linear_mixture_to_original.rst
================================================
espaloma.mm.functional.linear\_mixture\_to\_original
====================================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: linear_mixture_to_original

================================================
FILE: docs/autosummary/espaloma.mm.functional.lj.rst
================================================
espaloma.mm.functional.lj
=========================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: lj

================================================
FILE: docs/autosummary/espaloma.mm.functional.periodic.rst
================================================
espaloma.mm.functional.periodic
===============================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: periodic

================================================
FILE: docs/autosummary/espaloma.mm.functional.periodic_fixed_phases.rst
================================================
espaloma.mm.functional.periodic\_fixed\_phases
==============================================

.. currentmodule:: espaloma.mm.functional

.. autofunction:: periodic_fixed_phases

================================================
FILE: docs/autosummary/espaloma.mm.functional.rst
================================================
espaloma.mm.functional
======================

.. automodule:: espaloma.mm.functional
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      gaussian
      harmonic
      harmonic_harmonic_coupled
      harmonic_harmonic_periodic_coupled
      harmonic_periodic_coupled
      linear_mixture
      linear_mixture_to_original
      lj
      periodic
      periodic_fixed_phases
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.geometry.GeometryInGraph.rst
================================================
espaloma.mm.geometry.GeometryInGraph
====================================

.. currentmodule:: espaloma.mm.geometry

.. autoclass:: GeometryInGraph
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~GeometryInGraph.__init__
      ~GeometryInGraph.add_module
      ~GeometryInGraph.apply
      ~GeometryInGraph.bfloat16
      ~GeometryInGraph.buffers
      ~GeometryInGraph.children
      ~GeometryInGraph.cpu
      ~GeometryInGraph.cuda
      ~GeometryInGraph.double
      ~GeometryInGraph.eval
      ~GeometryInGraph.extra_repr
      ~GeometryInGraph.float
      ~GeometryInGraph.forward
      ~GeometryInGraph.half
      ~GeometryInGraph.load_state_dict
      ~GeometryInGraph.modules
      ~GeometryInGraph.named_buffers
      ~GeometryInGraph.named_children
      ~GeometryInGraph.named_modules
      ~GeometryInGraph.named_parameters
      ~GeometryInGraph.parameters
      ~GeometryInGraph.register_backward_hook
      ~GeometryInGraph.register_buffer
      ~GeometryInGraph.register_forward_hook
      ~GeometryInGraph.register_forward_pre_hook
      ~GeometryInGraph.register_parameter
      ~GeometryInGraph.requires_grad_
      ~GeometryInGraph.share_memory
      ~GeometryInGraph.state_dict
      ~GeometryInGraph.to
      ~GeometryInGraph.train
      ~GeometryInGraph.type
      ~GeometryInGraph.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~GeometryInGraph.T_destination
      ~GeometryInGraph.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.mm.geometry.angle.rst
================================================
espaloma.mm.geometry.angle
==========================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: angle

================================================
FILE: docs/autosummary/espaloma.mm.geometry.apply_angle.rst
================================================
espaloma.mm.geometry.apply\_angle
=================================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: apply_angle

================================================
FILE: docs/autosummary/espaloma.mm.geometry.apply_bond.rst
================================================
espaloma.mm.geometry.apply\_bond
================================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: apply_bond

================================================
FILE: docs/autosummary/espaloma.mm.geometry.apply_torsion.rst
================================================
espaloma.mm.geometry.apply\_torsion
===================================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: apply_torsion

================================================
FILE: docs/autosummary/espaloma.mm.geometry.copy_src.rst
================================================
espaloma.mm.geometry.copy\_src
==============================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: copy_src

================================================
FILE: docs/autosummary/espaloma.mm.geometry.dihedral.rst
================================================
espaloma.mm.geometry.dihedral
=============================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: dihedral

================================================
FILE: docs/autosummary/espaloma.mm.geometry.distance.rst
================================================
espaloma.mm.geometry.distance
=============================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: distance

================================================
FILE: docs/autosummary/espaloma.mm.geometry.geometry_in_graph.rst
================================================
espaloma.mm.geometry.geometry\_in\_graph
========================================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: geometry_in_graph

================================================
FILE: docs/autosummary/espaloma.mm.geometry.reduce_stack.rst
================================================
espaloma.mm.geometry.reduce\_stack
==================================

.. currentmodule:: espaloma.mm.geometry

.. autofunction:: reduce_stack

================================================
FILE: docs/autosummary/espaloma.mm.geometry.rst
================================================
espaloma.mm.geometry
====================

.. automodule:: espaloma.mm.geometry
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      angle
      apply_angle
      apply_bond
      apply_torsion
      copy_src
      dihedral
      distance
      geometry_in_graph
      reduce_stack
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      GeometryInGraph
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.arithmetic_mean.rst
================================================
espaloma.mm.nonbonded.arithmetic\_mean
======================================

.. currentmodule:: espaloma.mm.nonbonded

.. autofunction:: arithmetic_mean

================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.geometric_mean.rst
================================================
espaloma.mm.nonbonded.geometric\_mean
=====================================

.. currentmodule:: espaloma.mm.nonbonded

.. autofunction:: geometric_mean

================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.lj_12_6.rst
================================================
espaloma.mm.nonbonded.lj\_12\_6
===============================

.. currentmodule:: espaloma.mm.nonbonded

.. autofunction:: lj_12_6

================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.lj_9_6.rst
================================================
espaloma.mm.nonbonded.lj\_9\_6
==============================

.. currentmodule:: espaloma.mm.nonbonded

.. autofunction:: lj_9_6

================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.lorentz_berthelot.rst
================================================
espaloma.mm.nonbonded.lorentz\_berthelot
========================================

.. currentmodule:: espaloma.mm.nonbonded

.. autofunction:: lorentz_berthelot

================================================
FILE: docs/autosummary/espaloma.mm.nonbonded.rst
================================================
espaloma.mm.nonbonded
=====================

.. automodule:: espaloma.mm.nonbonded
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      arithmetic_mean
      geometric_mean
      lj_12_6
      lj_9_6
      lorentz_berthelot
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.mm.rst
================================================
espaloma.mm
===========

.. automodule:: espaloma.mm
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.mm.angle
   espaloma.mm.bond
   espaloma.mm.energy
   espaloma.mm.functional
   espaloma.mm.geometry
   espaloma.mm.nonbonded
   espaloma.mm.torsion



================================================
FILE: docs/autosummary/espaloma.mm.torsion.angle_angle.rst
================================================
espaloma.mm.torsion.angle\_angle
================================

.. currentmodule:: espaloma.mm.torsion

.. autofunction:: angle_angle

================================================
FILE: docs/autosummary/espaloma.mm.torsion.angle_angle_torsion.rst
================================================
espaloma.mm.torsion.angle\_angle\_torsion
=========================================

.. currentmodule:: espaloma.mm.torsion

.. autofunction:: angle_angle_torsion

================================================
FILE: docs/autosummary/espaloma.mm.torsion.angle_torsion.rst
================================================
espaloma.mm.torsion.angle\_torsion
==================================

.. currentmodule:: espaloma.mm.torsion

.. autofunction:: angle_torsion

================================================
FILE: docs/autosummary/espaloma.mm.torsion.bond_torsion.rst
================================================
espaloma.mm.torsion.bond\_torsion
=================================

.. currentmodule:: espaloma.mm.torsion

.. autofunction:: bond_torsion

================================================
FILE: docs/autosummary/espaloma.mm.torsion.periodic_torsion.rst
================================================
espaloma.mm.torsion.periodic\_torsion
=====================================

.. currentmodule:: espaloma.mm.torsion

.. autofunction:: periodic_torsion

================================================
FILE: docs/autosummary/espaloma.mm.torsion.rst
================================================
espaloma.mm.torsion
===================

.. automodule:: espaloma.mm.torsion
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      angle_angle
      angle_angle_torsion
      angle_torsion
      bond_torsion
      periodic_torsion
   
   

   
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.baselines.FreeParameterBaseline.rst
================================================
espaloma.nn.baselines.FreeParameterBaseline
===========================================

.. currentmodule:: espaloma.nn.baselines

.. autoclass:: FreeParameterBaseline
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~FreeParameterBaseline.__init__
      ~FreeParameterBaseline.add_module
      ~FreeParameterBaseline.apply
      ~FreeParameterBaseline.bfloat16
      ~FreeParameterBaseline.buffers
      ~FreeParameterBaseline.children
      ~FreeParameterBaseline.cpu
      ~FreeParameterBaseline.cuda
      ~FreeParameterBaseline.double
      ~FreeParameterBaseline.eval
      ~FreeParameterBaseline.extra_repr
      ~FreeParameterBaseline.float
      ~FreeParameterBaseline.forward
      ~FreeParameterBaseline.half
      ~FreeParameterBaseline.load_state_dict
      ~FreeParameterBaseline.modules
      ~FreeParameterBaseline.named_buffers
      ~FreeParameterBaseline.named_children
      ~FreeParameterBaseline.named_modules
      ~FreeParameterBaseline.named_parameters
      ~FreeParameterBaseline.parameters
      ~FreeParameterBaseline.register_backward_hook
      ~FreeParameterBaseline.register_buffer
      ~FreeParameterBaseline.register_forward_hook
      ~FreeParameterBaseline.register_forward_pre_hook
      ~FreeParameterBaseline.register_parameter
      ~FreeParameterBaseline.requires_grad_
      ~FreeParameterBaseline.share_memory
      ~FreeParameterBaseline.state_dict
      ~FreeParameterBaseline.to
      ~FreeParameterBaseline.train
      ~FreeParameterBaseline.type
      ~FreeParameterBaseline.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~FreeParameterBaseline.T_destination
      ~FreeParameterBaseline.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.baselines.FreeParameterBaselineInitMean.rst
================================================
espaloma.nn.baselines.FreeParameterBaselineInitMean
===================================================

.. currentmodule:: espaloma.nn.baselines

.. autoclass:: FreeParameterBaselineInitMean
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~FreeParameterBaselineInitMean.__init__
      ~FreeParameterBaselineInitMean.add_module
      ~FreeParameterBaselineInitMean.apply
      ~FreeParameterBaselineInitMean.bfloat16
      ~FreeParameterBaselineInitMean.buffers
      ~FreeParameterBaselineInitMean.children
      ~FreeParameterBaselineInitMean.cpu
      ~FreeParameterBaselineInitMean.cuda
      ~FreeParameterBaselineInitMean.double
      ~FreeParameterBaselineInitMean.eval
      ~FreeParameterBaselineInitMean.extra_repr
      ~FreeParameterBaselineInitMean.float
      ~FreeParameterBaselineInitMean.forward
      ~FreeParameterBaselineInitMean.half
      ~FreeParameterBaselineInitMean.load_state_dict
      ~FreeParameterBaselineInitMean.modules
      ~FreeParameterBaselineInitMean.named_buffers
      ~FreeParameterBaselineInitMean.named_children
      ~FreeParameterBaselineInitMean.named_modules
      ~FreeParameterBaselineInitMean.named_parameters
      ~FreeParameterBaselineInitMean.parameters
      ~FreeParameterBaselineInitMean.register_backward_hook
      ~FreeParameterBaselineInitMean.register_buffer
      ~FreeParameterBaselineInitMean.register_forward_hook
      ~FreeParameterBaselineInitMean.register_forward_pre_hook
      ~FreeParameterBaselineInitMean.register_parameter
      ~FreeParameterBaselineInitMean.requires_grad_
      ~FreeParameterBaselineInitMean.share_memory
      ~FreeParameterBaselineInitMean.state_dict
      ~FreeParameterBaselineInitMean.to
      ~FreeParameterBaselineInitMean.train
      ~FreeParameterBaselineInitMean.type
      ~FreeParameterBaselineInitMean.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~FreeParameterBaselineInitMean.T_destination
      ~FreeParameterBaselineInitMean.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.baselines.rst
================================================
espaloma.nn.baselines
=====================

.. automodule:: espaloma.nn.baselines
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      FreeParameterBaseline
      FreeParameterBaselineInitMean
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.layers.dgl_legacy.GN.rst
================================================
espaloma.nn.layers.dgl\_legacy.gn
=================================

.. currentmodule:: espaloma.nn.layers.dgl_legacy

.. autofunction:: gn

================================================
FILE: docs/autosummary/espaloma.nn.layers.dgl_legacy.rst
================================================
espaloma.nn.layers.dgl\_legacy
==============================

.. automodule:: espaloma.nn.layers.dgl_legacy
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      gn
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      GN
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.layers.rst
================================================
espaloma.nn.layers
==================

.. automodule:: espaloma.nn.layers
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.nn.layers.dgl_legacy



================================================
FILE: docs/autosummary/espaloma.nn.readout.base_readout.BaseReadout.rst
================================================
espaloma.nn.readout.base\_readout.BaseReadout
=============================================

.. currentmodule:: espaloma.nn.readout.base_readout

.. autoclass:: BaseReadout
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~BaseReadout.__init__
      ~BaseReadout.add_module
      ~BaseReadout.apply
      ~BaseReadout.bfloat16
      ~BaseReadout.buffers
      ~BaseReadout.children
      ~BaseReadout.cpu
      ~BaseReadout.cuda
      ~BaseReadout.double
      ~BaseReadout.eval
      ~BaseReadout.extra_repr
      ~BaseReadout.float
      ~BaseReadout.forward
      ~BaseReadout.half
      ~BaseReadout.load_state_dict
      ~BaseReadout.modules
      ~BaseReadout.named_buffers
      ~BaseReadout.named_children
      ~BaseReadout.named_modules
      ~BaseReadout.named_parameters
      ~BaseReadout.parameters
      ~BaseReadout.register_backward_hook
      ~BaseReadout.register_buffer
      ~BaseReadout.register_forward_hook
      ~BaseReadout.register_forward_pre_hook
      ~BaseReadout.register_parameter
      ~BaseReadout.requires_grad_
      ~BaseReadout.share_memory
      ~BaseReadout.state_dict
      ~BaseReadout.to
      ~BaseReadout.train
      ~BaseReadout.type
      ~BaseReadout.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~BaseReadout.T_destination
      ~BaseReadout.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.base_readout.rst
================================================
espaloma.nn.readout.base\_readout
=================================

.. automodule:: espaloma.nn.readout.base_readout
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      BaseReadout
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.readout.charge_equilibrium.ChargeEquilibrium.rst
================================================
espaloma.nn.readout.charge\_equilibrium.ChargeEquilibrium
=========================================================

.. currentmodule:: espaloma.nn.readout.charge_equilibrium

.. autoclass:: ChargeEquilibrium
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~ChargeEquilibrium.__init__
      ~ChargeEquilibrium.add_module
      ~ChargeEquilibrium.apply
      ~ChargeEquilibrium.bfloat16
      ~ChargeEquilibrium.buffers
      ~ChargeEquilibrium.children
      ~ChargeEquilibrium.cpu
      ~ChargeEquilibrium.cuda
      ~ChargeEquilibrium.double
      ~ChargeEquilibrium.eval
      ~ChargeEquilibrium.extra_repr
      ~ChargeEquilibrium.float
      ~ChargeEquilibrium.forward
      ~ChargeEquilibrium.half
      ~ChargeEquilibrium.load_state_dict
      ~ChargeEquilibrium.modules
      ~ChargeEquilibrium.named_buffers
      ~ChargeEquilibrium.named_children
      ~ChargeEquilibrium.named_modules
      ~ChargeEquilibrium.named_parameters
      ~ChargeEquilibrium.parameters
      ~ChargeEquilibrium.register_backward_hook
      ~ChargeEquilibrium.register_buffer
      ~ChargeEquilibrium.register_forward_hook
      ~ChargeEquilibrium.register_forward_pre_hook
      ~ChargeEquilibrium.register_parameter
      ~ChargeEquilibrium.requires_grad_
      ~ChargeEquilibrium.share_memory
      ~ChargeEquilibrium.state_dict
      ~ChargeEquilibrium.to
      ~ChargeEquilibrium.train
      ~ChargeEquilibrium.type
      ~ChargeEquilibrium.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~ChargeEquilibrium.T_destination
      ~ChargeEquilibrium.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.charge_equilibrium.get_charges.rst
================================================
espaloma.nn.readout.charge\_equilibrium.get\_charges
====================================================

.. currentmodule:: espaloma.nn.readout.charge_equilibrium

.. autofunction:: get_charges

================================================
FILE: docs/autosummary/espaloma.nn.readout.charge_equilibrium.rst
================================================
espaloma.nn.readout.charge\_equilibrium
=======================================

.. automodule:: espaloma.nn.readout.charge_equilibrium
  
   
   
   

   
   
   .. rubric:: Functions

   .. autosummary::
      :toctree:
   
      get_charges
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      ChargeEquilibrium
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.readout.graph_level_readout.GraphLevelReadout.rst
================================================
espaloma.nn.readout.graph\_level\_readout.GraphLevelReadout
===========================================================

.. currentmodule:: espaloma.nn.readout.graph_level_readout

.. autoclass:: GraphLevelReadout
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~GraphLevelReadout.__init__
      ~GraphLevelReadout.add_module
      ~GraphLevelReadout.apply
      ~GraphLevelReadout.bfloat16
      ~GraphLevelReadout.buffers
      ~GraphLevelReadout.children
      ~GraphLevelReadout.cpu
      ~GraphLevelReadout.cuda
      ~GraphLevelReadout.double
      ~GraphLevelReadout.eval
      ~GraphLevelReadout.extra_repr
      ~GraphLevelReadout.float
      ~GraphLevelReadout.forward
      ~GraphLevelReadout.half
      ~GraphLevelReadout.load_state_dict
      ~GraphLevelReadout.modules
      ~GraphLevelReadout.named_buffers
      ~GraphLevelReadout.named_children
      ~GraphLevelReadout.named_modules
      ~GraphLevelReadout.named_parameters
      ~GraphLevelReadout.parameters
      ~GraphLevelReadout.register_backward_hook
      ~GraphLevelReadout.register_buffer
      ~GraphLevelReadout.register_forward_hook
      ~GraphLevelReadout.register_forward_pre_hook
      ~GraphLevelReadout.register_parameter
      ~GraphLevelReadout.requires_grad_
      ~GraphLevelReadout.share_memory
      ~GraphLevelReadout.state_dict
      ~GraphLevelReadout.to
      ~GraphLevelReadout.train
      ~GraphLevelReadout.type
      ~GraphLevelReadout.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~GraphLevelReadout.T_destination
      ~GraphLevelReadout.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.graph_level_readout.rst
================================================
espaloma.nn.readout.graph\_level\_readout
=========================================

.. automodule:: espaloma.nn.readout.graph_level_readout
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      GraphLevelReadout
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.ExpCoefficients.rst
================================================
espaloma.nn.readout.janossy.ExpCoefficients
===========================================

.. currentmodule:: espaloma.nn.readout.janossy

.. autoclass:: ExpCoefficients
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~ExpCoefficients.__init__
      ~ExpCoefficients.add_module
      ~ExpCoefficients.apply
      ~ExpCoefficients.bfloat16
      ~ExpCoefficients.buffers
      ~ExpCoefficients.children
      ~ExpCoefficients.cpu
      ~ExpCoefficients.cuda
      ~ExpCoefficients.double
      ~ExpCoefficients.eval
      ~ExpCoefficients.extra_repr
      ~ExpCoefficients.float
      ~ExpCoefficients.forward
      ~ExpCoefficients.half
      ~ExpCoefficients.load_state_dict
      ~ExpCoefficients.modules
      ~ExpCoefficients.named_buffers
      ~ExpCoefficients.named_children
      ~ExpCoefficients.named_modules
      ~ExpCoefficients.named_parameters
      ~ExpCoefficients.parameters
      ~ExpCoefficients.register_backward_hook
      ~ExpCoefficients.register_buffer
      ~ExpCoefficients.register_forward_hook
      ~ExpCoefficients.register_forward_pre_hook
      ~ExpCoefficients.register_parameter
      ~ExpCoefficients.requires_grad_
      ~ExpCoefficients.share_memory
      ~ExpCoefficients.state_dict
      ~ExpCoefficients.to
      ~ExpCoefficients.train
      ~ExpCoefficients.type
      ~ExpCoefficients.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~ExpCoefficients.T_destination
      ~ExpCoefficients.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.JanossyPooling.rst
================================================
espaloma.nn.readout.janossy.JanossyPooling
==========================================

.. currentmodule:: espaloma.nn.readout.janossy

.. autoclass:: JanossyPooling
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~JanossyPooling.__init__
      ~JanossyPooling.add_module
      ~JanossyPooling.apply
      ~JanossyPooling.bfloat16
      ~JanossyPooling.buffers
      ~JanossyPooling.children
      ~JanossyPooling.cpu
      ~JanossyPooling.cuda
      ~JanossyPooling.double
      ~JanossyPooling.eval
      ~JanossyPooling.extra_repr
      ~JanossyPooling.float
      ~JanossyPooling.forward
      ~JanossyPooling.half
      ~JanossyPooling.load_state_dict
      ~JanossyPooling.modules
      ~JanossyPooling.named_buffers
      ~JanossyPooling.named_children
      ~JanossyPooling.named_modules
      ~JanossyPooling.named_parameters
      ~JanossyPooling.parameters
      ~JanossyPooling.register_backward_hook
      ~JanossyPooling.register_buffer
      ~JanossyPooling.register_forward_hook
      ~JanossyPooling.register_forward_pre_hook
      ~JanossyPooling.register_parameter
      ~JanossyPooling.requires_grad_
      ~JanossyPooling.share_memory
      ~JanossyPooling.state_dict
      ~JanossyPooling.to
      ~JanossyPooling.train
      ~JanossyPooling.type
      ~JanossyPooling.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~JanossyPooling.T_destination
      ~JanossyPooling.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.JanossyPoolingImproper.rst
================================================
espaloma.nn.readout.janossy.JanossyPoolingImproper
==================================================

.. currentmodule:: espaloma.nn.readout.janossy

.. autoclass:: JanossyPoolingImproper
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~JanossyPoolingImproper.__init__
      ~JanossyPoolingImproper.add_module
      ~JanossyPoolingImproper.apply
      ~JanossyPoolingImproper.bfloat16
      ~JanossyPoolingImproper.buffers
      ~JanossyPoolingImproper.children
      ~JanossyPoolingImproper.cpu
      ~JanossyPoolingImproper.cuda
      ~JanossyPoolingImproper.double
      ~JanossyPoolingImproper.eval
      ~JanossyPoolingImproper.extra_repr
      ~JanossyPoolingImproper.float
      ~JanossyPoolingImproper.forward
      ~JanossyPoolingImproper.half
      ~JanossyPoolingImproper.load_state_dict
      ~JanossyPoolingImproper.modules
      ~JanossyPoolingImproper.named_buffers
      ~JanossyPoolingImproper.named_children
      ~JanossyPoolingImproper.named_modules
      ~JanossyPoolingImproper.named_parameters
      ~JanossyPoolingImproper.parameters
      ~JanossyPoolingImproper.register_backward_hook
      ~JanossyPoolingImproper.register_buffer
      ~JanossyPoolingImproper.register_forward_hook
      ~JanossyPoolingImproper.register_forward_pre_hook
      ~JanossyPoolingImproper.register_parameter
      ~JanossyPoolingImproper.requires_grad_
      ~JanossyPoolingImproper.share_memory
      ~JanossyPoolingImproper.state_dict
      ~JanossyPoolingImproper.to
      ~JanossyPoolingImproper.train
      ~JanossyPoolingImproper.type
      ~JanossyPoolingImproper.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~JanossyPoolingImproper.T_destination
      ~JanossyPoolingImproper.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.JanossyPoolingNonbonded.rst
================================================
espaloma.nn.readout.janossy.JanossyPoolingNonbonded
===================================================

.. currentmodule:: espaloma.nn.readout.janossy

.. autoclass:: JanossyPoolingNonbonded
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~JanossyPoolingNonbonded.__init__
      ~JanossyPoolingNonbonded.add_module
      ~JanossyPoolingNonbonded.apply
      ~JanossyPoolingNonbonded.bfloat16
      ~JanossyPoolingNonbonded.buffers
      ~JanossyPoolingNonbonded.children
      ~JanossyPoolingNonbonded.cpu
      ~JanossyPoolingNonbonded.cuda
      ~JanossyPoolingNonbonded.double
      ~JanossyPoolingNonbonded.eval
      ~JanossyPoolingNonbonded.extra_repr
      ~JanossyPoolingNonbonded.float
      ~JanossyPoolingNonbonded.forward
      ~JanossyPoolingNonbonded.half
      ~JanossyPoolingNonbonded.load_state_dict
      ~JanossyPoolingNonbonded.modules
      ~JanossyPoolingNonbonded.named_buffers
      ~JanossyPoolingNonbonded.named_children
      ~JanossyPoolingNonbonded.named_modules
      ~JanossyPoolingNonbonded.named_parameters
      ~JanossyPoolingNonbonded.parameters
      ~JanossyPoolingNonbonded.register_backward_hook
      ~JanossyPoolingNonbonded.register_buffer
      ~JanossyPoolingNonbonded.register_forward_hook
      ~JanossyPoolingNonbonded.register_forward_pre_hook
      ~JanossyPoolingNonbonded.register_parameter
      ~JanossyPoolingNonbonded.requires_grad_
      ~JanossyPoolingNonbonded.share_memory
      ~JanossyPoolingNonbonded.state_dict
      ~JanossyPoolingNonbonded.to
      ~JanossyPoolingNonbonded.train
      ~JanossyPoolingNonbonded.type
      ~JanossyPoolingNonbonded.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~JanossyPoolingNonbonded.T_destination
      ~JanossyPoolingNonbonded.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.LinearMixtureToOriginal.rst
================================================
espaloma.nn.readout.janossy.LinearMixtureToOriginal
===================================================

.. currentmodule:: espaloma.nn.readout.janossy

.. autoclass:: LinearMixtureToOriginal
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~LinearMixtureToOriginal.__init__
      ~LinearMixtureToOriginal.add_module
      ~LinearMixtureToOriginal.apply
      ~LinearMixtureToOriginal.bfloat16
      ~LinearMixtureToOriginal.buffers
      ~LinearMixtureToOriginal.children
      ~LinearMixtureToOriginal.cpu
      ~LinearMixtureToOriginal.cuda
      ~LinearMixtureToOriginal.double
      ~LinearMixtureToOriginal.eval
      ~LinearMixtureToOriginal.extra_repr
      ~LinearMixtureToOriginal.float
      ~LinearMixtureToOriginal.forward
      ~LinearMixtureToOriginal.half
      ~LinearMixtureToOriginal.load_state_dict
      ~LinearMixtureToOriginal.modules
      ~LinearMixtureToOriginal.named_buffers
      ~LinearMixtureToOriginal.named_children
      ~LinearMixtureToOriginal.named_modules
      ~LinearMixtureToOriginal.named_parameters
      ~LinearMixtureToOriginal.parameters
      ~LinearMixtureToOriginal.register_backward_hook
      ~LinearMixtureToOriginal.register_buffer
      ~LinearMixtureToOriginal.register_forward_hook
      ~LinearMixtureToOriginal.register_forward_pre_hook
      ~LinearMixtureToOriginal.register_parameter
      ~LinearMixtureToOriginal.requires_grad_
      ~LinearMixtureToOriginal.share_memory
      ~LinearMixtureToOriginal.state_dict
      ~LinearMixtureToOriginal.to
      ~LinearMixtureToOriginal.train
      ~LinearMixtureToOriginal.type
      ~LinearMixtureToOriginal.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~LinearMixtureToOriginal.T_destination
      ~LinearMixtureToOriginal.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.janossy.rst
================================================
espaloma.nn.readout.janossy
===========================

.. automodule:: espaloma.nn.readout.janossy
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      ExpCoefficients
      JanossyPooling
      JanossyPoolingImproper
      JanossyPoolingNonbonded
      LinearMixtureToOriginal
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.readout.node_typing.NodeTyping.rst
================================================
espaloma.nn.readout.node\_typing.NodeTyping
===========================================

.. currentmodule:: espaloma.nn.readout.node_typing

.. autoclass:: NodeTyping
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~NodeTyping.__init__
      ~NodeTyping.add_module
      ~NodeTyping.apply
      ~NodeTyping.bfloat16
      ~NodeTyping.buffers
      ~NodeTyping.children
      ~NodeTyping.cpu
      ~NodeTyping.cuda
      ~NodeTyping.double
      ~NodeTyping.eval
      ~NodeTyping.extra_repr
      ~NodeTyping.float
      ~NodeTyping.forward
      ~NodeTyping.half
      ~NodeTyping.load_state_dict
      ~NodeTyping.modules
      ~NodeTyping.named_buffers
      ~NodeTyping.named_children
      ~NodeTyping.named_modules
      ~NodeTyping.named_parameters
      ~NodeTyping.parameters
      ~NodeTyping.register_backward_hook
      ~NodeTyping.register_buffer
      ~NodeTyping.register_forward_hook
      ~NodeTyping.register_forward_pre_hook
      ~NodeTyping.register_parameter
      ~NodeTyping.requires_grad_
      ~NodeTyping.share_memory
      ~NodeTyping.state_dict
      ~NodeTyping.to
      ~NodeTyping.train
      ~NodeTyping.type
      ~NodeTyping.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~NodeTyping.T_destination
      ~NodeTyping.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.readout.node_typing.rst
================================================
espaloma.nn.readout.node\_typing
================================

.. automodule:: espaloma.nn.readout.node_typing
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      NodeTyping
   
   

   
   
   





================================================
FILE: docs/autosummary/espaloma.nn.readout.rst
================================================
espaloma.nn.readout
===================

.. automodule:: espaloma.nn.readout
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.nn.readout.base_readout
   espaloma.nn.readout.charge_equilibrium
   espaloma.nn.readout.graph_level_readout
   espaloma.nn.readout.janossy
   espaloma.nn.readout.node_typing



================================================
FILE: docs/autosummary/espaloma.nn.rst
================================================
espaloma.nn
===========

.. automodule:: espaloma.nn
  
   
   
   

   
   
   

   
   
   

   
   
   



.. rubric:: Modules

.. autosummary::
   :toctree:
   :template: custom-module-template.rst
   :recursive:


   espaloma.nn.baselines
   espaloma.nn.layers
   espaloma.nn.readout
   espaloma.nn.sequential



================================================
FILE: docs/autosummary/espaloma.nn.sequential.Sequential.rst
================================================
espaloma.nn.sequential.Sequential
=================================

.. currentmodule:: espaloma.nn.sequential

.. autoclass:: Sequential
   :members:
   :show-inheritance:
   :inherited-members:

   
   .. automethod:: __init__

   
   .. rubric:: Methods

   .. autosummary::
   
      ~Sequential.__init__
      ~Sequential.add_module
      ~Sequential.apply
      ~Sequential.bfloat16
      ~Sequential.buffers
      ~Sequential.children
      ~Sequential.cpu
      ~Sequential.cuda
      ~Sequential.double
      ~Sequential.eval
      ~Sequential.extra_repr
      ~Sequential.float
      ~Sequential.forward
      ~Sequential.half
      ~Sequential.load_state_dict
      ~Sequential.modules
      ~Sequential.named_buffers
      ~Sequential.named_children
      ~Sequential.named_modules
      ~Sequential.named_parameters
      ~Sequential.parameters
      ~Sequential.register_backward_hook
      ~Sequential.register_buffer
      ~Sequential.register_forward_hook
      ~Sequential.register_forward_pre_hook
      ~Sequential.register_parameter
      ~Sequential.requires_grad_
      ~Sequential.share_memory
      ~Sequential.state_dict
      ~Sequential.to
      ~Sequential.train
      ~Sequential.type
      ~Sequential.zero_grad
   
   

   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~Sequential.T_destination
      ~Sequential.dump_patches
   
   

================================================
FILE: docs/autosummary/espaloma.nn.sequential.rst
================================================
espaloma.nn.sequential
======================

.. automodule:: espaloma.nn.sequential
  
   
   
   

   
   
   

   
   
   .. rubric:: Classes

   .. autosummary::
      :toctree:
      :template: custom-class-template.rst
   
      Sequential
   
   

   
   
   





================================================
FILE: docs/conf.py
================================================
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

# Incase the project was not installed
import os
import sys
import subprocess

sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

project = 'espaloma'
copyright = ("2020, Yuanqing Wang @ choderalab // MSKCC.")
author = 'Yuanqing Wang'
github_url = "https://github.com/choderalab/espaloma"

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''

# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autosummary',
    'sphinx.ext.autodoc',
    'sphinx.ext.mathjax',
    'sphinx.ext.viewcode',
    'sphinx.ext.napoleon',
    'sphinx.ext.intersphinx',
    'sphinx.ext.extlinks',
    'sphinx.ext.coverage',
    # 'numpydoc',
]

autosummary_generate = True
napoleon_google_docstring = False
napoleon_use_param = False
napoleon_use_ivar = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'default'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself.  Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'espalomadoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'espaloma.tex', 'espaloma Documentation',
     'espaloma', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'espaloma', 'espaloma Documentation',
     [author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'espaloma', 'espaloma Documentation',
     author, 'espaloma', 'Extensible Surrogate Potential of Ab initio Learned and Optimized by Message-passing Algorithm',
     'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------


================================================
FILE: docs/deploy.rst
================================================
Deploy espaloma 0.3.2 force field to parametrize your MM system
===============================================================
Pretrained espaloma force field could be deployed on arbitrary small molecule
systems in a few lines::

    # imports
    import os
    import torch
    import espaloma as esp
    
    # define or load a molecule of interest via the Open Force Field toolkit
    from openff.toolkit.topology import Molecule
    molecule = Molecule.from_smiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")
    
    # create an Espaloma Graph object to represent the molecule of interest
    molecule_graph = esp.Graph(molecule)
    
    # load pretrained model
    espaloma_model = esp.get_model("latest")
    
    # apply a trained espaloma model to assign parameters
    espaloma_model(molecule_graph.heterograph)
    
    # create an OpenMM System for the specified molecule
    openmm_system = esp.graphs.deploy.openmm_system_from_graph(molecule_graph)

If using espaloma from a local ``.pt`` file, say for example ``espaloma-0.3.2.pt``,
then you would need to run the ``eval`` method of the model to get the correct
inference/predictions, as follows::

    # load local pretrained model
    espaloma_model = torch.load("espaloma-0.3.2.pt")
    espaloma_model.eval()

The rest of the code should be the same as in the previous example.


================================================
FILE: docs/download_experiments.sh
================================================
export fileid=1qdHEypk3uMhZEYCStWTU8u1uIDHzH3Qy
wget -O typing.ipynb 'https://docs.google.com/uc?export=download&id='$fileid
ipython nbconvert typing.ipynb --to rst --TagRemovePreprocessor.remove_all_outputs_tags='{"remove_output"}'
mv typing.rst experiments/typing.rst

export fileid=1krhwGHKoqL5-_P0G89fDB7Iw3ENHW2G_
wget -O mm_fitting_small.ipynb 'https://docs.google.com/uc?export=download&id='$fileid
ipython nbconvert mm_fitting_small.ipynb --to rst --TagRemovePreprocessor.remove_all_outputs_tags='{"remove_output"}'
mv mm_fitting_small.rst experiments/mm_fitting_small.rst
mv mm_fitting_small_files experiments/mm_fitting_small_files

export fileid=1i_z0b0-m_91bMww1hY5Kdc76VHmtHsWD
wget -O qm_fitting.ipynb 'https://docs.google.com/uc?export=download&id='$fileid
ipython nbconvert qm_fitting.ipynb --to rst --TagRemovePreprocessor.remove_all_outputs_tags='{"remove_output"}'
cp qm_fitting.rst experiments/qm_fitting.rst

rm *.ipynb


================================================
FILE: docs/experiments/index.rst
================================================
To reproduce experiments in paper https://arxiv.org/abs/2010.01196


.. toctree::
   :maxdepth: 2
   :caption: Contents:

   typing
   mm_fitting_small
   qm_fitting


================================================
FILE: docs/experiments/mm_fitting_small.rst
================================================
Toy experiment: Molecular mechanics (MM) fitting on subsampled PhAlkEthOH dataset.
==================================================================================

**Open in Google Colab**:
http://data.wangyq.net/esp_notebooks/phalkethoh_mm_small.ipynb

This notebook is intended to recover the MM fitting behavior in
https://arxiv.org/abs/2010.01196

To assess how well Espaloma can learn to reproduce an MM force field
from a limited amount of data, we selected a chemical dataset of limited
complexity—PhAlkEthOH—which consists of linear and cyclic molecules
containing phenyl rings, small alkanes, ethers, and alcohols composed of
only the elements carbon, oxygen, and hydrogen. We generated a set of
conformational snapshots for each molecule using short high-temperature
molecular dynamics simulations at 300~K initiated from multiple
conformations to ensure adequate sampling of conformers. The AlkEthOH
dataset was randomly partitioned (by molecules) into 80% training, 10%
validation, and 10% test molecules, with 100 snapshots/molecule, and an
Espaloma model was trained with early stopping via monitoring for a
decrease in accuracy in the validation set.

.. image:: https://pbs.twimg.com/media/FBL0qACXIBkJLQZ?format=png&name=4096x4096

Installation and imports
------------------------

.. code:: python

    # install conda
    ! pip install -q condacolab
    import condacolab
    condacolab.install()


.. parsed-literal::

    ⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...
    📦 Installing...
    📌 Adjusting configuration...
    🩹 Patching environment...
    ⏲ Done in 0:00:34
    🔁 Restarting kernel...


.. code:: python

    %%capture
    ! mamba install --yes --strict-channel-priority --channel jaimergp/label/unsupported-cudatoolkit-shim --channel omnia --channel omnia/label/cuda100 --channel dglteam --channel numpy openmm openmmtools openmmforcefields rdkit openff-toolkit dgl-cuda10.0 qcportal

.. code:: python

    ! git clone https://github.com/choderalab/espaloma.git


.. parsed-literal::

    Cloning into 'espaloma'...
    remote: Enumerating objects: 7812, done.
    remote: Counting objects: 100% (3634/3634), done.
    remote: Compressing objects: 100% (1649/1649), done.
    remote: Total 7812 (delta 2714), reused 2639 (delta 1900), pack-reused 4178
    Receiving objects: 100% (7812/7812), 13.50 MiB | 11.77 MiB/s, done.
    Resolving deltas: 100% (5538/5538), done.


.. code:: python

    import torch
    import sys
    sys.path.append("/content/espaloma")
    import espaloma as esp


.. parsed-literal::

    Warning: Unable to load toolkit 'OpenEye Toolkit'. The Open Force Field Toolkit does not require the OpenEye Toolkits, and can use RDKit/AmberTools instead. However, if you have a valid license for the OpenEye Toolkits, consider installing them for faster performance and additional file format support: https://docs.eyesopen.com/toolkits/python/quickstart-python/linuxosx.html OpenEye offers free Toolkit licenses for academics: https://www.eyesopen.com/academic-licensing


Load dataset
------------

Here we load the PhAlKeThoh dataset and shuffle before splitting into
training, validation, and test (80%:10%:10%)

.. code:: python

    %%capture
    ! wget http://data.wangyq.net/esp_dataset/phalkethoh_mm_small.zip
    ! unzip phalkethoh_mm_small.zip

.. code:: python

    ds = esp.data.dataset.GraphDataset.load("phalkethoh")
    ds.shuffle(seed=2666)
    ds_tr, ds_vl, ds_te = ds.split([8, 1, 1])


.. parsed-literal::

    DGL backend not selected or invalid.  Assuming PyTorch for now.
    Using backend: pytorch


.. parsed-literal::

    Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable.  Valid options are: pytorch, mxnet, tensorflow (all lowercase)


A training dataloader is constructed with ``batch_size=100``

.. code:: python

    ds_tr_loader = ds_tr.view(batch_size=100, shuffle=True)

.. code:: python

    g_tr = next(iter(ds_tr.view(batch_size=len(ds_tr))))
    g_vl = next(iter(ds_vl.view(batch_size=len(ds_vl))))


.. parsed-literal::

    /usr/local/lib/python3.7/site-packages/dgl/base.py:45: DGLWarning: From v0.5, DGLHeteroGraph is merged into DGLGraph. You can safely replace dgl.batch_hetero with dgl.batch
      return warnings.warn(message, category=category, stacklevel=1)


Define model
------------

Define Espaloma stage I: graph -> atom latent representation

.. code:: python

    representation = esp.nn.Sequential(
        layer=esp.nn.layers.dgl_legacy.gn("SAGEConv"), # use SAGEConv implementation in DGL
        config=[128, "relu", 128, "relu", 128, "relu"], # 3 layers, 128 units, ReLU activation
    )

Define Espaloma stage II and III: atom latent representation -> bond,
angle, and torsion representation and parameters. And compose all three
Espaloma stages into an end-to-end model.

.. code:: python

    readout = esp.nn.readout.janossy.JanossyPooling(
        in_features=128, config=[128, "relu", 128, "relu", 128, "relu"],
        out_features={              # define modular MM parameters Espaloma will assign
            1: {"e": 1, "s": 1}, # atom hardness and electronegativity
            2: {"log_coefficients": 2}, # bond linear combination, enforce positive
            3: {"log_coefficients": 2}, # angle linear combination, enforce positive
            4: {"k": 6}, # torsion barrier heights (can be positive or negative)
        },
    )
    
    espaloma_model = torch.nn.Sequential(
                     representation, readout, esp.nn.readout.janossy.ExpCoefficients(),
                     esp.mm.geometry.GeometryInGraph(), 
                     esp.mm.energy.EnergyInGraph(),
                     esp.mm.energy.EnergyInGraph(suffix="_ref"),
                     esp.nn.readout.charge_equilibrium.ChargeEquilibrium(),
    )


.. code:: python

    if torch.cuda.is_available():
        espaloma_model = espaloma_model.cuda()

Loss function is specified as the MSE between predicted and reference
energy.

.. code:: python

    loss_fn = esp.metrics.GraphMetric(
            base_metric=torch.nn.MSELoss(), # use mean-squared error loss
            between=['u', "u_ref"],         # between predicted and QM energies
            level="g", # compare on graph level
    )

Define optimizer
----------------

.. code:: python

    optimizer = torch.optim.Adam(espaloma_model.parameters(), 1e-4)

Train it!
---------

.. code:: python

    for idx_epoch in range(10000):
        for g in ds_tr_loader:
            optimizer.zero_grad()
            if torch.cuda.is_available():
                g = g.to("cuda:0")
            g = espaloma_model(g)
            loss = loss_fn(g)
            loss.backward()
            optimizer.step()
            torch.save(espaloma_model.state_dict(), "%s.th" % idx_epoch)


.. parsed-literal::

    /usr/local/lib/python3.7/site-packages/dgl/base.py:45: DGLWarning: From v0.5, DGLHeteroGraph is merged into DGLGraph. You can safely replace dgl.batch_hetero with dgl.batch
      return warnings.warn(message, category=category, stacklevel=1)
    /usr/local/lib/python3.7/site-packages/dgl/base.py:45: DGLWarning: dgl.to_homo is deprecated. Please use dgl.to_homogeneous
      return warnings.warn(message, category=category, stacklevel=1)


Inspect
-------

.. code:: python

    inspect_metric = esp.metrics.GraphMetric(
            base_metric=torch.nn.L1Loss(), # use mean-squared error loss
            between=['u', "u_ref"],         # between predicted and QM energies
            level="g", # compare on graph level
    )

.. code:: python

    if torch.cuda.is_available():
        g_vl = g_vl.to("cuda:0")
        g_tr = g_tr.to("cuda:0")

.. code:: python

    loss_tr = []
    loss_vl = []

.. code:: python

    for idx_epoch in range(10000):
        espaloma_model.load_state_dict(
            torch.load("%s.th" % idx_epoch)
        )
    
        espaloma_model(g_tr)
        loss_tr.append(inspect_metric(g_tr).item())
    
        espaloma_model(g_vl)
        loss_vl.append(inspect_metric(g_vl).item())



.. parsed-literal::

    /usr/local/lib/python3.7/site-packages/dgl/base.py:45: DGLWarning: dgl.to_homo is deprecated. Please use dgl.to_homogeneous
      return warnings.warn(message, category=category, stacklevel=1)


.. code:: python

    import numpy as np
    loss_tr = np.array(loss_tr) * 627.5
    loss_vl = np.array(loss_vl) * 627.5

.. code:: python

    from matplotlib import pyplot as plt 
    plt.plot(loss_tr, label="train")
    plt.plot(loss_vl, label="valid")
    plt.yscale("log")
    plt.legend()




.. parsed-literal::

    <matplotlib.legend.Legend at 0x7fd8f0eebd90>




.. image:: mm_fitting_small_files/mm_fitting_small_31_1.png




================================================
FILE: docs/experiments/qm_fitting.rst
================================================
Quantum mechanics (QM) fitting experiment.
==========================================

**Open in Google Colab:**
http://data.wangyq.net/esp_notesbooks/qm_fitting.ipynb

This notebook recovers the QM fitting experiment in
https://arxiv.org/abs/2010.01196

|image1| **Table 2:** Espaloma can directly fit quantum chemical
energies to produce a new molecular mechanics force fields with better
accuracy than traditional force fields based on atom typing or direct
chemical perception. Espaloma was fit to quantum chemical potential
energies for conformations generated by optimization trajectories from
multiple conformers in various datasets from QCArchive.All datasets were
partitioned by molecules 80:10:10 into train:validate:test sets. We
report the RMSE on training and test sets, as well as the performance of
legacy force fields on the test set. All statistics are computed with
predicted and reference energies centered to have zero mean for each
molecule to focus on errors in relative conformational energetics,
rather than on errors in predicting the heats of formation of chemical
species (which the MM functional form used here is incapable of). The
95% confidence intervals annotated are calculated by via bootstrapping
molecules with replacement using 1000 replicates. \*: Six cyclic
peptides that cannot be parametrized using OpenForceField toolkit
engine~:raw-latex:`\cite{openff-toolkit-0.10.0}` and is not included.

Since Espaloma can derive a force field solely by fitting to energies
(and optionally gradients), we repeat the end-to-end fitting experiment
(See notebook
http://data.wangyq.net/esp_notebooks/phalkethoh_mm_small.ipynb) directly
using a quantum chemical (QM) datasets used to build and evaluate MM
force fields. We assessed the ability of Espaloma to learn several
distinct quantum chemical datasets generated by the Open Force Field
Initiativeand deposited in the MolSSI QCArchive: - **PhAlkEthOH** is a
collection of compounds containing only the elements carbon, hydrogen,
and oxygen in compounds containing phenyl rings, alkanes, ketones, and
alcohols. Limited in elemental and chemical diversity, this dataset is
chosen as a proof-of-concept to demonstrate the capability of Espaloma
to fit and generalize quantum chemical energies when training data is
sufficient to exhaustively cover the breadth of chemical environments. -
**OpenFF Gen2 Optimization** consists of druglike molecules used in the
parametrization of the Open Force Field 1.2.0 (“Parsley”) small molecule
force field. This set was constructed by the Open Force Field Consortium
from challenging molecule structures provided by Pfizer, Bayer, and
Roche, along with diverse molecules selected from eMolecules to achieve
useful coverage of chemical space. - **VEHICLe**, or *virtual
exploratory heterocyclic library*, is a set of heteroaromatic ring
systems of interest to drug discovery. The atoms in the molecules in
this dataset have interesting chemical environments in heteroarmatic
rings that present a challenge to traditional atom typing schemes, which
cannot easily accomodate the nuanced distinctions in chemical
environments that lead to perturbations in heterocycle structure.We use
this dataset to illustrate that Espaloma performs in situations
challenging to traditional force fields. - **PepConf** contains a
variety of short peptides, including capped, cyclic, and
disulfide-bonded peptides.This dataset—regenerated using the Open Force
Field QCSubmit tool—explores the applicability of Espaloma to
biopolymers, such as proteins.

Since nonbonded terms are generally optimized to fit other
condensed-phase properties, we focused here on optimizing only the
valence parameters (bond, angle, and proper and improper torsion) to fit
these gas-phase quantum chemical datasets, fixing the non-bonded
energies using a legacy force field. Because we are learning an MM force
field that is incapable of reproducing quantum chemical heats of
formation reflected as an additive offset in the quantum chemical energy
targets, in both training and test sets, snapshot energies for each
molecule are shifted to have zero mean. All datasets are randomly
shuffled and split (by molecules) into training (80%), validation (10%),
and test (10%) sets.

.. |image1| image:: https://pbs.twimg.com/media/FBL1Gb0WEAYkUhM?format=png&name=4096x4096

Installation and imports
------------------------

.. code:: python

    # install conda
    ! pip install -q condacolab
    import condacolab
    condacolab.install()

.. code:: python

    %%capture
    ! mamba install --yes --strict-channel-priority --channel jaimergp/label/unsupported-cudatoolkit-shim --channel omnia --channel omnia/label/cuda100 --channel dglteam --channel numpy openmm openmmtools openmmforcefields rdkit openff-toolkit dgl-cuda10.0 qcportal

.. code:: python

    ! git clone https://github.com/choderalab/espaloma.git

.. code:: python

    import torch
    import sys
    sys.path.append("/content/espaloma")
    import espaloma as esp

Load dataset
------------

Choose a dataset from ``["gen2", "pepconf", "vehicle", "phalkethoh"]``.

.. code:: python

    dataset_name = "gen2"
    # dataset_name = "pepconf"
    # dataset_name = "vehicle"
    # dataset_name = "phalkethoh"

.. code:: python

    %%capture
    ! wget "data.wangyq.net/esp_dataset/"$dataset_name".zip"
    ! unzip $dataset_name".zip"

.. code:: python

    ds = esp.data.dataset.GraphDataset.load(dataset_name)
    ds.shuffle(seed=2666)
    ds_tr, ds_vl, ds_te = ds.split([8, 1, 1])

Define model
------------

Define Espaloma stage I: graph -> atom latent representation

.. code:: python

    representation = esp.nn.Sequential(
        layer=esp.nn.layers.dgl_legacy.gn("SAGEConv"), # use SAGEConv implementation in DGL
        config=[128, "relu", 128, "relu", 128, "relu"], # 3 layers, 128 units, ReLU activation
    )

Define Espaloma stage II and III: atom latent representation -> bond,
angle, and torsion representation and parameters. And compose all three
Espaloma stages into an end-to-end model.

.. code:: python

    readout = esp.nn.readout.janossy.JanossyPooling(
        in_features=128, config=[128, "relu", 128, "relu", 128, "relu"],
        out_features={              # define modular MM parameters Espaloma will assign
            1: {"e": 1, "s": 1}, # atom hardness and electronegativity
            2: {"log_coefficients": 2}, # bond linear combination, enforce positive
            3: {"log_coefficients": 2}, # angle linear combination, enforce positive
            4: {"k": 6}, # torsion barrier heights (can be positive or negative)
        },
    )
    
    espaloma_model = torch.nn.Sequential(
                     representation, readout, esp.nn.readout.janossy.ExpCoefficients(),
                     esp.mm.geometry.GeometryInGraph(), 
                     esp.mm.energy.EnergyInGraph(),
    )


.. code:: python

    if torch.cuda.is_available():
        espaloma_model = espaloma_model.cuda()

Loss function is specified as the MSE between predicted and reference
energy.

.. code:: python

    loss_fn = esp.metrics.GraphMetric(
            base_metric=torch.nn.MSELoss(), # use mean-squared error loss
            between=['u', "u_ref"],         # between predicted and QM energies
            level="g", # compare on graph level
    )

Define optimizer
----------------

.. code:: python

    optimizer = torch.optim.Adam(espaloma_model.parameters(), 1e-4)

Train it!
---------

.. code:: python

    for idx_epoch in range(10000):
        for g in ds_tr:
            optimizer.zero_grad()
            if torch.cuda.is_available():
                g.heterograph = g.heterograph.to("cuda:0")
            g = espaloma_model(g.heterograph)
            loss = loss_fn(g)
            loss.backward()
            optimizer.step()
        torch.save(espaloma_model.state_dict(), "%s.th" % idx_epoch)

Inspect
-------

.. code:: python

    inspect_metric = esp.metrics.center(torch.nn.L1Loss()) # use mean-squared error loss

.. code:: python

    loss_tr = []
    loss_vl = []

.. code:: python

    with torch.no_grad():
        for idx_epoch in range(10000):
            espaloma_model.load_state_dict(
                torch.load("%s.th" % idx_epoch)
            )
    
            # training set performance
            u = []
            u_ref = []
            for g in ds_tr:
                if torch.cuda.is_available():
                    g.heterograph = g.heterograph.to("cuda:0")
                espaloma_model(g.heterograph)
                u.append(g.nodes['g'].data['u'])
                u_ref.append(g.nodes['g'])
            u = torch.cat(u, dim=0)
            u_ref = torch.cat(u_ref, dim=0)
            loss_tr.append(inspect_metric(u, u_ref))
    
    
            # validation set performance
            u = []
            u_ref = []
            for g in ds_vl:
                if torch.cuda.is_available():
                    g.heterograph = g.heterograph.to("cuda:0")
                espaloma_model(g.heterograph)
                u.append(g.nodes['g'].data['u'])
                u_ref.append(g.nodes['g'])
            u = torch.cat(u, dim=0)
            u_ref = torch.cat(u_ref, dim=0)
            loss_vl.append(inspect_metric(u, u_ref))


.. code:: python

    import numpy as np
    loss_tr = np.array(loss_tr) * 627.5
    loss_vl = np.array(loss_vl) * 627.5

.. code:: python

    from matplotlib import pyplot as plt 
    plt.plot(loss_tr, label="train")
    plt.plot(loss_vl, label="valid")
    plt.yscale("log")
    plt.legend()


================================================
FILE: docs/experiments/typing.rst
================================================
Atom typing recovery experiment.
================================

**Open in Google Colab**:
http://data.wangyq.net/esp_notebooks/typing.ipynb

(GPU preferred)

In this notebook, we reproduce the atom typing recovery experiment in
`Wang Y, Fass J, and Chodera JD “End-to-End Differentiable Construction
of Molecular Mechanics Force
Fields <https://arxiv.org/abs/2010.01196>`__

(Section 3: Graph neural networks can learn to reproduce human-defined
legacy atom types with high accuracy; Figure 3. Graph neural networks
can reproduce legacy atom types with high accuracy.)

.. image:: https://pbs.twimg.com/media/FBLz_6sWUAM2iHa?format=jpg&name=4096x4096

Graph neural networks can reproduce legacy atom types with high
accuracy.

The Stage 1 graph neural network of Espaloma chained to a discrete atom
type readout was fit to GAFF 1.81 atom types on a subset of ZINC
distributed with parm Frosst as a validation set .

The 7529 molecules in this set were partitioned 80:10:10 into
training:test:validation sets for this experiment. The overall test set
accuracy was :math:`99.07\%_{98.93\%}^{99.22\%}`, with 1000 bootstrap
replicates used to estimate the confidence intervals arising from finite
test set size effects. (a) The distribution of the number of atom type
discrepancies on the test set demonstrates that only a minority of atoms
are incorrectly typed. (b) The error rate per element is primarily
concentrated within carbon, nitrogen, and sulfur types. (c) Examining
atom type failures in detail on molecules with the largest numbers of
discrepancies shows that the atom types are easily confused by a human,
since they represent qualities that are difficult to precisely define.
(d) The distribution of predicted atom types for each reference atom
type for carbon types are shown; on-diagonal values indicate agreement.
The percentages annotated under x-axis denote the relative abundance
within the test set.

Installation and Imports
------------------------

First, we install espaloma after all of its dependencies. Note that this
is going to be significantly simplified.

.. code:: python

    %%capture
    ! wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    ! bash Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
    ! conda config --add channels conda-forge --add channels omnia --add channels omnia/label/cuda100 --add channels dglteam
    ! conda update --yes --all
    ! conda create --yes -n openmm python=3.6 numpy openmm openmmtools rdkit openforcefield==0.7.0 dgl-cuda10.0 qcportal
    ! git clone https://github.com/choderalab/espaloma.git

.. code:: python

    import torch
    import dgl
    import numpy as np

Get dataset
-----------

.. code:: python

    import os
    if not os.path.exists("zinc"):
        os.system("wget data.wangyq.net/esp_datasets/zinc")
    ds = esp.data.dataset.GraphDataset.load("zinc")

Assign legacy typing
--------------------

Next, we assign legacy typings using `GAFF-1.81 force
field. <https://github.com/openmm/openmmforcefields/blob/master/amber/gaff/dat/gaff-1.81.dat#L20-L32>`__

.. code:: python

    typing = esp.graphs.legacy_force_field.LegacyForceField('gaff-1.81')
    ds.apply(typing, in_place=True) # this modify the original data

Data massaging
--------------

We then split the data into training, test, and validatoin (80:10:10)
and batch the the datasets.

.. code:: python

    ds_tr, ds_te, ds_vl = ds.split([8, 1, 1])

.. code:: python

    ds_tr = ds_tr.view('graph', batch_size=100, shuffle=True)
    ds_te = ds_te.view('graph', batch_size=100)
    ds_vl = ds_vl.view('graph', batch_size=100)

Defining model
--------------

We define a graph neural network (GNN) model with
`SAGEConv <https://arxiv.org/abs/1706.02216>`__ with 128 units, three
layers, and ReLU activation functions.

.. code:: python

    # define a layer
    layer = esp.nn.layers.dgl_legacy.gn("SAGEConv")
    
    # define a representation
    representation = esp.nn.Sequential(
            layer,
            [128, "relu", 128, "relu", 128, "relu"],
    )
    
    # define a readout
    readout = esp.nn.readout.node_typing.NodeTyping(
            in_features=128,
            n_classes=100
    )
    
    net = torch.nn.Sequential(
        representation,
        readout
    )

Define graph-level loss function
--------------------------------

.. code:: python

    loss_fn = esp.metrics.TypingAccuracy()

Train the model
---------------

.. code:: python

    # define optimizer
    optimizer = torch.optim.Adam(net.parameters(), 1e-5)
    
    # train the model
    for _ in range(3000):
        for g in ds_tr:
            optimizer.zero_grad()
            net(g.heterograph)
            loss = loss_fn(g.heterograph)
            loss.backward()
            optimizer.step()



================================================
FILE: docs/index.rst
================================================
.. espaloma documentation master file, created by
   sphinx-quickstart on Thu Mar 15 13:55:56 2018.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

espaloma: Extensible Surrogate Potential Optimized by Message-passing Algorithms
=========================================================

Source code for Wang Y, Fass J, and Chodera JD "End-to-End Differentiable Construction of Molecular Mechanics Force Fields. https://arxiv.org/abs/2010.01196

.. image:: _static/espaloma_abstract_v2-2.png

Paper Abstract
--------------
Molecular mechanics (MM) potentials have long been a workhorse of computational chemistry.
Leveraging accuracy and speed, these functional forms find use in a wide variety of applications in biomolecular modeling and drug discovery, from rapid virtual screening to detailed free energy calculations.
Traditionally, MM potentials have relied on human-curated, inflexible, and poorly extensible discrete chemical perception rules *atom types* for applying parameters to small molecules or biopolymers, making it difficult to optimize both types and parameters to fit quantum chemical or physical property data.
Here, we propose an alternative approach that uses *graph neural networks* to perceive chemical environments, producing continuous atom embeddings from which valence and nonbonded parameters can be predicted using invariance-preserving layers.
Since all stages are built from smooth neural functions, the entire process---spanning chemical perception to parameter assignment---is modular and end-to-end differentiable with respect to model parameters, allowing new force fields to be easily constructed, extended, and applied to arbitrary molecules.
We show that this approach is not only sufficiently expressive to reproduce legacy atom types, but that it can learn and extend existing molecular mechanics force fields, construct entirely new force fields applicable to both biopolymers and small molecules from quantum chemical calculations, and even learn to accurately predict free energies from experimental observables.


Lab Meeting
-----------
.. raw:: html

    <iframe width="600" height="450" src="https://www.youtube.com/embed/OC210nUuXHk"></iframe>

Full video: https://youtu.be/OC210nUuXHk


.. toctree::
   :maxdepth: 2
   :caption: Contents:

   install
   deploy
   experiments/index
   api


Indices and tables
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


================================================
FILE: docs/install.rst
================================================
Installation
============

mamba
-----

We recommend using `mamba <https://mamba.readthedocs.io/en/latest/mamba-installation.html#mamba-installation>`_ which is a drop-in replacement for ``conda`` and is much faster.

.. code-block:: bash

   $ mamba create --name espaloma -c conda-forge "espaloma=0.3.2"

================================================
FILE: docs/make.bat
================================================
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=malt

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd


================================================
FILE: docs/qm_fitting.rst
================================================
Quantum mechanics (QM) fitting experiment.
==========================================

**Open in Google Colab:**
http://data.wangyq.net/esp_notesbooks/qm_fitting.ipynb

This notebook recovers the QM fitting experiment in
https://arxiv.org/abs/2010.01196

|image1| **Table 2:** Espaloma can directly fit quantum chemical
energies to produce a new molecular mechanics force fields with better
accuracy than traditional force fields based on atom typing or direct
chemical perception. Espaloma was fit to quantum chemical potential
energies for conformations generated by optimization trajectories from
multiple conformers in various datasets from QCArchive.All datasets were
partitioned by molecules 80:10:10 into train:validate:test sets. We
report the RMSE on training and test sets, as well as the performance of
legacy force fields on the test set. All statistics are computed with
predicted and reference energies centered to have zero mean for each
molecule to focus on errors in relative conformational energetics,
rather than on errors in predicting the heats of formation of chemical
species (which the MM functional form used here is incapable of). The
95% confidence intervals annotated are calculated by via bootstrapping
molecules with replacement using 1000 replicates. \*: Six cyclic
peptides that cannot be parametrized using OpenForceField toolkit
engine~:raw-latex:`\cite{openff-toolkit-0.10.0}` and is not included.

Since Espaloma can derive a force field solely by fitting to energies
(and optionally gradients), we repeat the end-to-end fitting experiment
(See notebook
http://data.wangyq.net/esp_notebooks/phalkethoh_mm_small.ipynb) directly
using a quantum chemical (QM) datasets used to build and evaluate MM
force fields. We assessed the ability of Espaloma to learn several
distinct quantum chemical datasets generated by the Open Force Field
Initiativeand deposited in the MolSSI QCArchive: - **PhAlkEthOH** is a
collection of compounds containing only the elements carbon, hydrogen,
and oxygen in compounds containing phenyl rings, alkanes, ketones, and
alcohols. Limited in elemental and chemical diversity, this dataset is
chosen as a proof-of-concept to demonstrate the capability of Espaloma
to fit and generalize quantum chemical energies when training data is
sufficient to exhaustively cover the breadth of chemical environments. -
**OpenFF Gen2 Optimization** consists of druglike molecules used in the
parametrization of the Open Force Field 1.2.0 (“Parsley”) small molecule
force field. This set was constructed by the Open Force Field Consortium
from challenging molecule structures provided by Pfizer, Bayer, and
Roche, along with diverse molecules selected from eMolecules to achieve
useful coverage of chemical space. - **VEHICLe**, or *virtual
exploratory heterocyclic library*, is a set of heteroaromatic ring
systems of interest to drug discovery. The atoms in the molecules in
this dataset have interesting chemical environments in heteroarmatic
rings that present a challenge to traditional atom typing schemes, which
cannot easily accomodate the nuanced distinctions in chemical
environments that lead to perturbations in heterocycle structure.We use
this dataset to illustrate that Espaloma performs in situations
challenging to traditional force fields. - **PepConf** contains a
variety of short peptides, including capped, cyclic, and
disulfide-bonded peptides.This dataset—regenerated using the Open Force
Field QCSubmit tool—explores the applicability of Espaloma to
biopolymers, such as proteins.

Since nonbonded terms are generally optimized to fit other
condensed-phase properties, we focused here on optimizing only the
valence parameters (bond, angle, and proper and improper torsion) to fit
these gas-phase quantum chemical datasets, fixing the non-bonded
energies using a legacy force field. Because we are learning an MM force
field that is incapable of reproducing quantum chemical heats of
formation reflected as an additive offset in the quantum chemical energy
targets, in both training and test sets, snapshot energies for each
molecule are shifted to have zero mean. All datasets are randomly
shuffled and split (by molecules) into training (80%), validation (10%),
and test (10%) sets.

.. |image1| image:: https://pbs.twimg.com/media/FBL1Gb0WEAYkUhM?format=png&name=4096x4096

Installation and imports
------------------------

.. code:: python

    # install conda
    ! pip install -q condacolab
    import condacolab
    condacolab.install()

.. code:: python

    %%capture
    ! mamba install --yes --strict-channel-priority --channel jaimergp/label/unsupported-cudatoolkit-shim --channel omnia --channel omnia/label/cuda100 --channel dglteam --channel numpy openmm openmmtools openmmforcefields rdkit openff-toolkit dgl-cuda10.0 qcportal

.. code:: python

    ! git clone https://github.com/choderalab/espaloma.git

.. code:: python

    import torch
    import sys
    sys.path.append("/content/espaloma")
    import espaloma as esp

Load dataset
------------

Choose a dataset from ``["gen2", "pepconf", "vehicle", "phalkethoh"]``.

.. code:: python

    dataset_name = "gen2"
    # dataset_name = "pepconf"
    # dataset_name = "vehicle"
    # dataset_name = "phalkethoh"

.. code:: python

    %%capture
    ! wget "data.wangyq.net/esp_dataset/"$dataset_name".zip"
    ! unzip $dataset_name".zip"

.. code:: python

    ds = esp.data.dataset.GraphDataset.load(dataset_name)
    ds.shuffle(seed=2666)
    ds_tr, ds_vl, ds_te = ds.split([8, 1, 1])

Define model
------------

Define Espaloma stage I: graph -> atom latent representation

.. code:: python

    representation = esp.nn.Sequential(
        layer=esp.nn.layers.dgl_legacy.gn("SAGEConv"), # use SAGEConv implementation in DGL
        config=[128, "relu", 128, "relu", 128, "relu"], # 3 layers, 128 units, ReLU activation
    )

Define Espaloma stage II and III: atom latent representation -> bond,
angle, and torsion representation and parameters. And compose all three
Espaloma stages into an end-to-end model.

.. code:: python

    readout = esp.nn.readout.janossy.JanossyPooling(
        in_features=128, config=[128, "relu", 128, "relu", 128, "relu"],
        out_features={              # define modular MM parameters Espaloma will assign
            1: {"e": 1, "s": 1}, # atom hardness and electronegativity
            2: {"log_coefficients": 2}, # bond linear combination, enforce positive
            3: {"log_coefficients": 2}, # angle linear combination, enforce positive
            4: {"k": 6}, # torsion barrier heights (can be positive or negative)
        },
    )
    
    espaloma_model = torch.nn.Sequential(
                     representation, readout, esp.nn.readout.janossy.ExpCoefficients(),
                     esp.mm.geometry.GeometryInGraph(), 
                     esp.mm.energy.EnergyInGraph(),
    )


.. code:: python

    if torch.cuda.is_available():
        espaloma_model = espaloma_model.cuda()

Loss function is specified as the MSE between predicted and reference
energy.

.. code:: python

    loss_fn = esp.metrics.GraphMetric(
            base_metric=torch.nn.MSELoss(), # use mean-squared error loss
            between=['u', "u_ref"],         # between predicted and QM energies
            level="g", # compare on graph level
    )

Define optimizer
----------------

.. code:: python

    optimizer = torch.optim.Adam(espaloma_model.parameters(), 1e-4)

Train it!
---------

.. code:: python

    for idx_epoch in range(10000):
        for g in ds_tr:
            optimizer.zero_grad()
            if torch.cuda.is_available():
                g.heterograph = g.heterograph.to("cuda:0")
            g = espaloma_model(g.heterograph)
            loss = loss_fn(g)
            loss.backward()
            optimizer.step()
        torch.save(espaloma_model.state_dict(), "%s.th" % idx_epoch)

Inspect
-------

.. code:: python

    inspect_metric = esp.metrics.center(torch.nn.L1Loss()) # use mean-squared error loss

.. code:: python

    loss_tr = []
    loss_vl = []

.. code:: python

    with torch.no_grad():
        for idx_epoch in range(10000):
            espaloma_model.load_state_dict(
                torch.load("%s.th" % idx_epoch)
            )
    
            # training set performance
            u = []
            u_ref = []
            for g in ds_tr:
                if torch.cuda.is_available():
                    g.heterograph = g.heterograph.to("cuda:0")
                espaloma_model(g.heterograph)
                u.append(g.nodes['g'].data['u'])
                u_ref.append(g.nodes['g'])
            u = torch.cat(u, dim=0)
            u_ref = torch.cat(u_ref, dim=0)
            loss_tr.append(inspect_metric(u, u_ref))
    
    
            # validation set performance
            u = []
            u_ref = []
            for g in ds_vl:
                if torch.cuda.is_available():
                    g.heterograph = g.heterograph.to("cuda:0")
                espaloma_model(g.heterograph)
                u.append(g.nodes['g'].data['u'])
                u_ref.append(g.nodes['g'])
            u = torch.cat(u, dim=0)
            u_ref = torch.cat(u_ref, dim=0)
            loss_vl.append(inspect_metric(u, u_ref))


.. code:: python

    import numpy as np
    loss_tr = np.array(loss_tr) * 627.5
    loss_vl = np.array(loss_vl) * 627.5

.. code:: python

    from matplotlib import pyplot as plt 
    plt.plot(loss_tr, label="train")
    plt.plot(loss_vl, label="valid")
    plt.yscale("log")
    plt.legend()


================================================
FILE: espaloma/.py
================================================


================================================
FILE: espaloma/__init__.py
================================================
"""
espaloma
Extensible Surrogate Potential of Ab initio Learned and Optimized by Message-passing Algorithm
"""

from . import metrics, units, data, app, graphs, mm, nn
from .app.experiment import *
from .graphs.graph import Graph
from .metrics import GraphMetric
from .mm.geometry import *
from .utils.model_fetch import get_model, get_model_path

# Add imports here
# import espaloma


# Handle versioneer
from ._version import get_versions

#
# from openff.toolkit.utils.toolkits import ToolkitRegistry, OpenEyeToolkitWrapper, RDKitToolkitWrapper, AmberToolsToolkitWrapper
# toolkit_registry = ToolkitRegistry()
# toolkit_precedence = [ RDKitToolkitWrapper ] # , OpenEyeToolkitWrapper, AmberToolsToolkitWrapper]
# [ toolkit_registry.register_toolkit(toolkit) for toolkit in toolkit_precedence if toolkit.is_available() ]
#


versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions

from . import _version
__version__ = _version.get_versions()['version']


================================================
FILE: espaloma/_version.py
================================================

# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.

# This file is released into the public domain.
# Generated by versioneer-0.29
# https://github.com/python-versioneer/python-versioneer

"""Git implementation of _version.py."""

import errno
import os
import re
import subprocess
import sys
from typing import Any, Callable, Dict, List, Optional, Tuple
import functools


def get_keywords() -> Dict[str, str]:
    """Get the keywords needed to look up the version information."""
    # these strings will be replaced by git during git-archive.
    # setup.py/versioneer.py will grep for the variable names, so they must
    # each be defined on a line of their own. _version.py will just call
    # get_keywords().
    git_refnames = "$Format:%d$"
    git_full = "$Format:%H$"
    git_date = "$Format:%ci$"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
    return keywords


class VersioneerConfig:
    """Container for Versioneer configuration parameters."""

    VCS: str
    style: str
    tag_prefix: str
    parentdir_prefix: str
    versionfile_source: str
    verbose: bool


def get_config() -> VersioneerConfig:
    """Create, populate and return the VersioneerConfig() object."""
    # these strings are filled in when 'setup.py versioneer' creates
    # _version.py
    cfg = VersioneerConfig()
    cfg.VCS = "git"
    cfg.style = "pep440"
    cfg.tag_prefix = ""
    cfg.parentdir_prefix = "None"
    cfg.versionfile_source = "espaloma/_version.py"
    cfg.verbose = False
    return cfg


class NotThisMethod(Exception):
    """Exception raised if a method is not valid for the current scenario."""


LONG_VERSION_PY: Dict[str, str] = {}
HANDLERS: Dict[str, Dict[str, Callable]] = {}


def register_vcs_handler(vcs: str, method: str) -> Callable:  # decorator
    """Create decorator to mark a method as the handler of a VCS."""
    def decorate(f: Callable) -> Callable:
        """Store f in HANDLERS[vcs][method]."""
        if vcs not in HANDLERS:
            HANDLERS[vcs] = {}
        HANDLERS[vcs][method] = f
        return f
    return decorate


def run_command(
    commands: List[str],
    args: List[str],
    cwd: Optional[str] = None,
    verbose: bool = False,
    hide_stderr: bool = False,
    env: Optional[Dict[str, str]] = None,
) -> Tuple[Optional[str], Optional[int]]:
    """Call the given command(s)."""
    assert isinstance(commands, list)
    process = None

    popen_kwargs: Dict[str, Any] = {}
    if sys.platform == "win32":
        # This hides the console window if pythonw.exe is used
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        popen_kwargs["startupinfo"] = startupinfo

    for command in commands:
        try:
            dispcmd = str([command] + args)
            # remember shell=False, so use git.cmd on windows, not just git
            process = subprocess.Popen([command] + args, cwd=cwd, env=env,
                                       stdout=subprocess.PIPE,
                                       stderr=(subprocess.PIPE if hide_stderr
                                               else None), **popen_kwargs)
            break
        except OSError as e:
            if e.errno == errno.ENOENT:
                continue
            if verbose:
                print("unable to run %s" % dispcmd)
                print(e)
            return None, None
    else:
        if verbose:
            print("unable to find command, tried %s" % (commands,))
        return None, None
    stdout = process.communicate()[0].strip().decode()
    if process.returncode != 0:
        if verbose:
            print("unable to run %s (error)" % dispcmd)
            print("stdout was %s" % stdout)
        return None, process.returncode
    return stdout, process.returncode


def versions_from_parentdir(
    parentdir_prefix: str,
    root: str,
    verbose: bool,
) -> Dict[str, Any]:
    """Try to determine the version from the parent directory name.

    Source tarballs conventionally unpack into a directory that includes both
    the project name and a version string. We will also support searching up
    two directory levels for an appropriately named parent directory
    """
    rootdirs = []

    for _ in range(3):
        dirname = os.path.basename(root)
        if dirname.startswith(parentdir_prefix):
            return {"version": dirname[len(parentdir_prefix):],
                    "full-revisionid": None,
                    "dirty": False, "error": None, "date": None}
        rootdirs.append(root)
        root = os.path.dirname(root)  # up a level

    if verbose:
        print("Tried directories %s but none started with prefix %s" %
              (str(rootdirs), parentdir_prefix))
    raise NotThisMethod("rootdir doesn't start with parentdir_prefix")


@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
    """Extract version information from the given file."""
    # the code embedded in _version.py can just fetch the value of these
    # keywords. When used from setup.py, we don't want to import _version.py,
    # so we do it with a regexp instead. This function is not used from
    # _version.py.
    keywords: Dict[str, str] = {}
    try:
        with open(versionfile_abs, "r") as fobj:
            for line in fobj:
                if line.strip().startswith("git_refnames ="):
                    mo = re.search(r'=\s*"(.*)"', line)
                    if mo:
                        keywords["refnames"] = mo.group(1)
                if line.strip().startswith("git_full ="):
                    mo = re.search(r'=\s*"(.*)"', line)
                    if mo:
                        keywords["full"] = mo.group(1)
                if line.strip().startswith("git_date ="):
                    mo = re.search(r'=\s*"(.*)"', line)
                    if mo:
                        keywords["date"] = mo.group(1)
    except OSError:
        pass
    return keywords


@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(
    keywords: Dict[str, str],
    tag_prefix: str,
    verbose: bool,
) -> Dict[str, Any]:
    """Get version information from git keywords."""
    if "refnames" not in keywords:
        raise NotThisMethod("Short version file found")
    date = keywords.get("date")
    if date is not None:
        # Use only the last line.  Previous lines may contain GPG signature
        # information.
        date = date.splitlines()[-1]

        # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
        # datestamp. However we prefer "%ci" (which expands to an "ISO-8601
        # -like" string, which we must then edit to make compliant), because
        # it's been around since git-1.5.3, and it's too difficult to
        # discover which version we're using, or to work around using an
        # older one.
        date = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
    refnames = keywords["refnames"].strip()
    if refnames.startswith("$Format"):
        if verbose:
            print("keywords are unexpanded, not using")
        raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
    refs = {r.strip() for r in refnames.strip("()").split(",")}
    # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
    # just "foo-1.0". If we see a "tag: " prefix, prefer those.
    TAG = "tag: "
    tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
    if not tags:
        # Either we're using git < 1.8.3, or there really are no tags. We use
        # a heuristic: assume all version tags have a digit. The old git %d
        # expansion behaves like git log --decorate=short and strips out the
        # refs/heads/ and refs/tags/ prefixes that would let us distinguish
        # between branches and tags. By ignoring refnames without digits, we
        # filter out many common branch names like "release" and
        # "stabilization", as well as "HEAD" and "master".
        tags = {r for r in refs if re.search(r'\d', r)}
        if verbose:
            print("discarding '%s', no digits" % ",".join(refs - tags))
    if verbose:
        print("likely tags: %s" % ",".join(sorted(tags)))
    for ref in sorted(tags):
        # sorting will prefer e.g. "2.0" over "2.0rc1"
        if ref.startswith(tag_prefix):
            r = ref[len(tag_prefix):]
            # Filter out refs that exactly match prefix or that don't start
            # with a number once the prefix is stripped (mostly a concern
            # when prefix is '')
            if not re.match(r'\d', r):
                continue
            if verbose:
                print("picking %s" % r)
            return {"version": r,
                    "full-revisionid": keywords["full"].strip(),
                    "dirty": False, "error": None,
                    "date": date}
    # no suitable tags, so version is "0+unknown", but full hex is still there
    if verbose:
        print("no suitable tags, using unknown + full revision id")
    return {"version": "0+unknown",
            "full-revisionid": keywords["full"].strip(),
            "dirty": False, "error": "no suitable tags", "date": None}


@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(
    tag_prefix: str,
    root: str,
    verbose: bool,
    runner: Callable = run_command
) -> Dict[str, Any]:
    """Get version from 'git describe' in the root of the source tree.

    This only gets called if the git-archive 'subst' keywords were *not*
    expanded, and _version.py hasn't already been rewritten with a short
    version string, meaning we're inside a checked out source tree.
    """
    GITS = ["git"]
    if sys.platform == "win32":
        GITS = ["git.cmd", "git.exe"]

    # GIT_DIR can interfere with correct operation of Versioneer.
    # It may be intended to be passed to the Versioneer-versioned project,
    # but that should not change where we get our version from.
    env = os.environ.copy()
    env.pop("GIT_DIR", None)
    runner = functools.partial(runner, env=env)

    _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
                   hide_stderr=not verbose)
    if rc != 0:
        if verbose:
            print("Directory %s not under git control" % root)
        raise NotThisMethod("'git rev-parse --git-dir' returned error")

    # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
    # if there isn't one, this yields HEX[-dirty] (no NUM)
    describe_out, rc = runner(GITS, [
        "describe", "--tags", "--dirty", "--always", "--long",
        "--match", f"{tag_prefix}[[:digit:]]*"
    ], cwd=root)
    # --long was added in git-1.5.5
    if describe_out is None:
        raise NotThisMethod("'git describe' failed")
    describe_out = describe_out.strip()
    full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root)
    if full_out is None:
        raise NotThisMethod("'git rev-parse' failed")
    full_out = full_out.strip()

    pieces: Dict[str, Any] = {}
    pieces["long"] = full_out
    pieces["short"] = full_out[:7]  # maybe improved later
    pieces["error"] = None

    branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
                             cwd=root)
    # --abbrev-ref was added in git-1.6.3
    if rc != 0 or branch_name is None:
        raise NotThisMethod("'git rev-parse --abbrev-ref' returned error")
    branch_name = branch_name.strip()

    if branch_name == "HEAD":
        # If we aren't exactly on a branch, pick a branch which represents
        # the current commit. If all else fails, we are on a branchless
        # commit.
        branches, rc = runner(GITS, ["branch", "--contains"], cwd=root)
        # --contains was added in git-1.5.4
        if rc != 0 or branches is None:
            raise NotThisMethod("'git branch --contains' returned error")
        branches = branches.split("\n")

        # Remove the first line if we're running detached
        if "(" in branches[0]:
            branches.pop(0)

        # Strip off the leading "* " from the list of branches.
        branches = [branch[2:] for branch in branches]
        if "master" in branches:
            branch_name = "master"
        elif not branches:
            branch_name = None
        else:
            # Pick the first branch that is returned. Good or bad.
            branch_name = branches[0]

    pieces["branch"] = branch_name

    # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
    # TAG might have hyphens.
    git_describe = describe_out

    # look for -dirty suffix
    dirty = git_describe.endswith("-dirty")
    pieces["dirty"] = dirty
    if dirty:
        git_describe = git_describe[:git_describe.rindex("-dirty")]

    # now we have TAG-NUM-gHEX or HEX

    if "-" in git_describe:
        # TAG-NUM-gHEX
        mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
        if not mo:
            # unparsable. Maybe git-describe is misbehaving?
            pieces["error"] = ("unable to parse git-describe output: '%s'"
                               % describe_out)
            return pieces

        # tag
        full_tag = mo.group(1)
        if not full_tag.startswith(tag_prefix):
            if verbose:
                fmt = "tag '%s' doesn't start with prefix '%s'"
                print(fmt % (full_tag, tag_prefix))
            pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
                               % (full_tag, tag_prefix))
            return pieces
        pieces["closest-tag"] = full_tag[len(tag_prefix):]

        # distance: number of commits since tag
        pieces["distance"] = int(mo.group(2))

        # commit: short hex revision ID
        pieces["short"] = mo.group(3)

    else:
        # HEX: no tags
        pieces["closest-tag"] = None
        out, rc = runner(GITS, ["rev-list", "HEAD", "--left-right"], cwd=root)
        pieces["distance"] = len(out.split())  # total number of commits

    # commit date: see ISO-8601 comment in git_versions_from_keywords()
    date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip()
    # Use only the last line.  Previous lines may contain GPG signature
    # information.
    date = date.splitlines()[-1]
    pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)

    return pieces


def plus_or_dot(pieces: Dict[str, Any]) -> str:
    """Return a + if we don't already have one, else return a ."""
    if "+" in pieces.get("closest-tag", ""):
        return "."
    return "+"


def render_pep440(pieces: Dict[str, Any]) -> str:
    """Build up version string, with post-release "local version identifier".

    Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
    get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty

    Exceptions:
    1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"] or pieces["dirty"]:
            rendered += plus_or_dot(pieces)
            rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
            if pieces["dirty"]:
                rendered += ".dirty"
    else:
        # exception #1
        rendered = "0+untagged.%d.g%s" % (pieces["distance"],
                                          pieces["short"])
        if pieces["dirty"]:
            rendered += ".dirty"
    return rendered


def render_pep440_branch(pieces: Dict[str, Any]) -> str:
    """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] .

    The ".dev0" means not master branch. Note that .dev0 sorts backwards
    (a feature branch will appear "older" than the master branch).

    Exceptions:
    1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty]
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"] or pieces["dirty"]:
            if pieces["branch"] != "master":
                rendered += ".dev0"
            rendered += plus_or_dot(pieces)
            rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
            if pieces["dirty"]:
                rendered += ".dirty"
    else:
        # exception #1
        rendered = "0"
        if pieces["branch"] != "master":
            rendered += ".dev0"
        rendered += "+untagged.%d.g%s" % (pieces["distance"],
                                          pieces["short"])
        if pieces["dirty"]:
            rendered += ".dirty"
    return rendered


def pep440_split_post(ver: str) -> Tuple[str, Optional[int]]:
    """Split pep440 version string at the post-release segment.

    Returns the release segments before the post-release and the
    post-release version number (or -1 if no post-release segment is present).
    """
    vc = str.split(ver, ".post")
    return vc[0], int(vc[1] or 0) if len(vc) == 2 else None


def render_pep440_pre(pieces: Dict[str, Any]) -> str:
    """TAG[.postN.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post0.devDISTANCE
    """
    if pieces["closest-tag"]:
        if pieces["distance"]:
            # update the post release segment
            tag_version, post_version = pep440_split_post(pieces["closest-tag"])
            rendered = tag_version
            if post_version is not None:
                rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"])
            else:
                rendered += ".post0.dev%d" % (pieces["distance"])
        else:
            # no commits, use the tag as the version
            rendered = pieces["closest-tag"]
    else:
        # exception #1
        rendered = "0.post0.dev%d" % pieces["distance"]
    return rendered


def render_pep440_post(pieces: Dict[str, Any]) -> str:
    """TAG[.postDISTANCE[.dev0]+gHEX] .

    The ".dev0" means dirty. Note that .dev0 sorts backwards
    (a dirty tree will appear "older" than the corresponding clean one),
    but you shouldn't be releasing software with -dirty anyways.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"] or pieces["dirty"]:
            rendered += ".post%d" % pieces["distance"]
            if pieces["dirty"]:
                rendered += ".dev0"
            rendered += plus_or_dot(pieces)
            rendered += "g%s" % pieces["short"]
    else:
        # exception #1
        rendered = "0.post%d" % pieces["distance"]
        if pieces["dirty"]:
            rendered += ".dev0"
        rendered += "+g%s" % pieces["short"]
    return rendered


def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
    """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .

    The ".dev0" means not master branch.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty]
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"] or pieces["dirty"]:
            rendered += ".post%d" % pieces["distance"]
            if pieces["branch"] != "master":
                rendered += ".dev0"
            rendered += plus_or_dot(pieces)
            rendered += "g%s" % pieces["short"]
            if pieces["dirty"]:
                rendered += ".dirty"
    else:
        # exception #1
        rendered = "0.post%d" % pieces["distance"]
        if pieces["branch"] != "master":
            rendered += ".dev0"
        rendered += "+g%s" % pieces["short"]
        if pieces["dirty"]:
            rendered += ".dirty"
    return rendered


def render_pep440_old(pieces: Dict[str, Any]) -> str:
    """TAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"] or pieces["dirty"]:
            rendered += ".post%d" % pieces["distance"]
            if pieces["dirty"]:
                rendered += ".dev0"
    else:
        # exception #1
        rendered = "0.post%d" % pieces["distance"]
        if pieces["dirty"]:
            rendered += ".dev0"
    return rendered


def render_git_describe(pieces: Dict[str, Any]) -> str:
    """TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"]:
            rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
    else:
        # exception #1
        rendered = pieces["short"]
    if pieces["dirty"]:
        rendered += "-dirty"
    return rendered


def render_git_describe_long(pieces: Dict[str, Any]) -> str:
    """TAG-DISTANCE-gHEX[-dirty].

    Like 'git describe --tags --dirty --always -long'.
    The distance/hash is unconditional.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
    else:
        # exception #1
        rendered = pieces["short"]
    if pieces["dirty"]:
        rendered += "-dirty"
    return rendered


def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
    """Render the given version pieces into the requested style."""
    if pieces["error"]:
        return {"version": "unknown",
                "full-revisionid": pieces.get("long"),
                "dirty": None,
                "error": pieces["error"],
                "date": None}

    if not style or style == "default":
        style = "pep440"  # the default

    if style == "pep440":
        rendered = render_pep440(pieces)
    elif style == "pep440-branch":
        rendered = render_pep440_branch(pieces)
    elif style == "pep440-pre":
        rendered = render_pep440_pre(pieces)
    elif style == "pep440-post":
        rendered = render_pep440_post(pieces)
    elif style == "pep440-post-branch":
        rendered = render_pep440_post_branch(pieces)
    elif style == "pep440-old":
        rendered = render_pep440_old(pieces)
    elif style == "git-describe":
        rendered = render_git_describe(pieces)
    elif style == "git-describe-long":
        rendered = render_git_describe_long(pieces)
    else:
        raise ValueError("unknown style '%s'" % style)

    return {"version": rendered, "full-revisionid": pieces["long"],
            "dirty": pieces["dirty"], "error": None,
            "date": pieces.get("date")}


def get_versions() -> Dict[str, Any]:
    """Get version information or return default if unable to do so."""
    # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
    # __file__, we can work backwards from there to the root. Some
    # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
    # case we can only use expanded keywords.

    cfg = get_config()
    verbose = cfg.verbose

    try:
        return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
                                          verbose)
    except NotThisMethod:
        pass

    try:
        root = os.path.realpath(__file__)
        # versionfile_source is the relative path from the top of the source
        # tree (where the .git directory might live) to this file. Invert
        # this to find the root from __file__.
        for _ in cfg.versionfile_source.split('/'):
            root = os.path.dirname(root)
    except NameError:
        return {"version": "0+unknown", "full-revisionid": None,
                "dirty": None,
                "error": "unable to find root of source tree",
                "date": None}

    try:
        pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
        return render(pieces, cfg.style)
    except NotThisMethod:
        pass

    try:
        if cfg.parentdir_prefix:
            return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
    except NotThisMethod:
        pass

    return {"version": "0+unknown", "full-revisionid": None,
            "dirty": None,
            "error": "unable to compute version", "date": None}


================================================
FILE: espaloma/app/__init__.py
================================================
from . import experiment, report


================================================
FILE: espaloma/app/experiment.py
================================================
# =============================================================================
# IMPORTS
# =============================================================================
import abc
import copy
import torch

import espaloma as esp


# =============================================================================
# MODULE CLASSES
# =============================================================================
class Experiment(abc.ABC):
    """Base class for espaloma experiment."""

    def __init__(self):
        super(Experiment, self).__init__()


class Train(Experiment):
    """Training experiment.

    Parameters
    ----------
    net : `torch.nn.Module`
        Neural networks that inputs graph representation and outputs
        parameterized or typed graph for molecular mechanics.

    data : `espaloma.data.dataset.Dataset`
        or `torch.utils.data.DataLoader`
        Dataset.

    metrics : `List` of `callable`
        List of loss functions to be used (summed) in training.

    optimizer : `torch.optim.Optimizer`
        Optimizer used for training.

    n_epochs : `int`
        Number of epochs.

    record_interval : `int`
        Interval at which states are recorded.

    Methods
    -------
    train_once : Train the network for exactly once.

    train : Execute `train_once` for `n_epochs` times and record states
        every `record_interval`.

    """

    def __init__(
        self,
        net,
        data,
        metrics=[esp.metrics.TypingCrossEntropy()],
        optimizer=lambda net: torch.optim.Adam(net.parameters(), 1e-3),
        n_epochs=100,
        record_interval=1,
        normalize=esp.data.normalize.ESOL100LogNormalNormalize,
        scheduler=None,
        device=torch.device("cpu"),
    ):
        super(Train, self).__init__()

        # bookkeeping
        self.device = device
        if isinstance(net, torch.nn.DataParallel):
            self.net = net
        elif isinstance(net, torch.nn.parallel.DistributedDataParallel):
            self.net = net
        else:
            self.net = net.to(self.device)
        self.data = data
        self.metrics = metrics
        self.n_epochs = n_epochs
        self.record_interval = record_interval
        self.normalize = normalize()
        self.states = {}
        self.scheduler = scheduler

        # make optimizer
        if callable(optimizer):
            self.optimizer = optimizer(net)
        else:
            self.optimizer = optimizer

        # compose loss function
        def loss(g):
            _loss = 0.0
            for metric in self.metrics:
                _loss += metric(g)

            return _loss

        self.loss = loss

    def train_once(self):
        """Train the model for one batch."""
        for idx, g in enumerate(
            self.data
        ):  # TODO: does this have to be a single g?

            if isinstance(self.optimizer, torch.optim.LBFGS):
                retain_graph = True
            else:
                retain_graph = False

            g = g.to(self.device)
            self.net.train()

            def closure(g=g):
                self.optimizer.zero_grad()
                g = self.net(g)
                g = self.normalize.unnorm(g)

                loss = self.loss(g)
                loss.backward(retain_graph=retain_graph)
                if idx == 0:
                    if torch.isnan(loss).cpu().numpy().item() is True:
                        raise RuntimeError("Loss is Nan.")
                return loss

            loss = closure()
            self.optimizer.step()

            if self.scheduler is not None:
                self.scheduler.step(loss)

    def train(self):
        """Train the model for multiple steps and
        record the weights once every `record_interval`

        """

        for epoch_idx in range(int(self.n_epochs)):

            self.train_once()

            # record when `record_interval` is hit
            if epoch_idx % self.record_interval == 0:
                self.states[epoch_idx] = copy.deepcopy(self.net.state_dict())

        # record final state
        self.states["final"] = copy.deepcopy(self.net.state_dict())

        return self.net


class Test(Experiment):
    """Test experiment.

    Par
Download .txt
gitextract_8sr_6d4i/

├── .codecov.yml
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── CI.yaml
│       ├── clean_cache.yaml
│       └── docker.yaml
├── .gitignore
├── .readthedocs.yaml
├── LICENSE
├── MANIFEST.in
├── README.md
├── devtools/
│   ├── README.md
│   ├── conda-envs/
│   │   └── espaloma.yaml
│   ├── conda-recipe/
│   │   ├── build.sh
│   │   └── meta.yml
│   ├── gh-actions/
│   │   └── initialize_conda.sh
│   └── scripts/
│       └── create_conda_env.py
├── docker/
│   └── Dockerfile
├── docs/
│   ├── Makefile
│   ├── README.md
│   ├── _static/
│   │   └── README.md
│   ├── _templates/
│   │   ├── README.md
│   │   ├── custom-class-template.rst
│   │   └── custom-module-template.rst
│   ├── api.rst
│   ├── autosummary/
│   │   ├── espaloma.data.collection.alkethoh.rst
│   │   ├── espaloma.data.collection.esol.rst
│   │   ├── espaloma.data.collection.md17_new.rst
│   │   ├── espaloma.data.collection.md17_old.rst
│   │   ├── espaloma.data.collection.qca.rst
│   │   ├── espaloma.data.collection.rst
│   │   ├── espaloma.data.collection.zinc.rst
│   │   ├── espaloma.data.dataset.Dataset.rst
│   │   ├── espaloma.data.dataset.GraphDataset.rst
│   │   ├── espaloma.data.dataset.rst
│   │   ├── espaloma.data.md.MoleculeVacuumSimulation.rst
│   │   ├── espaloma.data.md.rst
│   │   ├── espaloma.data.md.subtract_nonbonded_force.rst
│   │   ├── espaloma.data.md.subtract_nonbonded_force_except_14.rst
│   │   ├── espaloma.data.md17_utils.get_molecule.rst
│   │   ├── espaloma.data.md17_utils.realize_molecule.rst
│   │   ├── espaloma.data.md17_utils.rst
│   │   ├── espaloma.data.md17_utils.sum_offsets.rst
│   │   ├── espaloma.data.normalize.BaseNormalize.rst
│   │   ├── espaloma.data.normalize.DatasetLogNormalNormalize.rst
│   │   ├── espaloma.data.normalize.DatasetNormalNormalize.rst
│   │   ├── espaloma.data.normalize.ESOL100LogNormalNormalize.rst
│   │   ├── espaloma.data.normalize.ESOL100NormalNormalize.rst
│   │   ├── espaloma.data.normalize.NotNormalize.rst
│   │   ├── espaloma.data.normalize.PositiveNotNormalize.rst
│   │   ├── espaloma.data.normalize.rst
│   │   ├── espaloma.data.qcarchive_utils.MolWithTargets.rst
│   │   ├── espaloma.data.qcarchive_utils.breakdown_along_time_axis.rst
│   │   ├── espaloma.data.qcarchive_utils.fetch_td_record.rst
│   │   ├── espaloma.data.qcarchive_utils.get_client.rst
│   │   ├── espaloma.data.qcarchive_utils.get_collection.rst
│   │   ├── espaloma.data.qcarchive_utils.get_energy_and_gradient.rst
│   │   ├── espaloma.data.qcarchive_utils.get_graph.rst
│   │   ├── espaloma.data.qcarchive_utils.h5_to_dataset.rst
│   │   ├── espaloma.data.qcarchive_utils.make_batch_size_consistent.rst
│   │   ├── espaloma.data.qcarchive_utils.rst
│   │   ├── espaloma.data.qcarchive_utils.weight_by_snapshots.rst
│   │   ├── espaloma.data.rst
│   │   ├── espaloma.data.utils.batch.rst
│   │   ├── espaloma.data.utils.collate_fn.rst
│   │   ├── espaloma.data.utils.from_csv.rst
│   │   ├── espaloma.data.utils.infer_mol_from_coordinates.rst
│   │   ├── espaloma.data.utils.make_temp_directory.rst
│   │   ├── espaloma.data.utils.normalize.rst
│   │   ├── espaloma.data.utils.rst
│   │   ├── espaloma.data.utils.split.rst
│   │   ├── espaloma.data.utils.sum_offsets.rst
│   │   ├── espaloma.graphs.deploy.load_forcefield.rst
│   │   ├── espaloma.graphs.deploy.openmm_system_from_graph.rst
│   │   ├── espaloma.graphs.deploy.rst
│   │   ├── espaloma.graphs.graph.BaseGraph.rst
│   │   ├── espaloma.graphs.graph.Graph.rst
│   │   ├── espaloma.graphs.graph.rst
│   │   ├── espaloma.graphs.legacy_force_field.LegacyForceField.rst
│   │   ├── espaloma.graphs.legacy_force_field.rst
│   │   ├── espaloma.graphs.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.angle_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.atom_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.bond_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.improper_torsion_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.proper_torsion_indices.rst
│   │   ├── espaloma.graphs.utils.offmol_indices.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.duplicate_index_ordering.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.from_homogeneous_and_mol.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.relationship_indices_from_offmol.rst
│   │   ├── espaloma.graphs.utils.read_heterogeneous_graph.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.fp_oe.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.fp_rdkit.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_oemol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_openff_toolkit_mol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.from_rdkit_mol.rst
│   │   ├── espaloma.graphs.utils.read_homogeneous_graph.rst
│   │   ├── espaloma.graphs.utils.rst
│   │   ├── espaloma.mm.angle.angle_high.rst
│   │   ├── espaloma.mm.angle.bond_angle.rst
│   │   ├── espaloma.mm.angle.bond_bond.rst
│   │   ├── espaloma.mm.angle.harmonic_angle.rst
│   │   ├── espaloma.mm.angle.linear_mixture_angle.rst
│   │   ├── espaloma.mm.angle.rst
│   │   ├── espaloma.mm.angle.urey_bradley.rst
│   │   ├── espaloma.mm.bond.bond_high.rst
│   │   ├── espaloma.mm.bond.gaussian_bond.rst
│   │   ├── espaloma.mm.bond.harmonic_bond.rst
│   │   ├── espaloma.mm.bond.linear_mixture_bond.rst
│   │   ├── espaloma.mm.bond.rst
│   │   ├── espaloma.mm.energy.CarryII.rst
│   │   ├── espaloma.mm.energy.EnergyInGraph.rst
│   │   ├── espaloma.mm.energy.EnergyInGraphII.rst
│   │   ├── espaloma.mm.energy.apply_angle.rst
│   │   ├── espaloma.mm.energy.apply_angle_ii.rst
│   │   ├── espaloma.mm.energy.apply_angle_linear_mixture.rst
│   │   ├── espaloma.mm.energy.apply_bond.rst
│   │   ├── espaloma.mm.energy.apply_bond_gaussian.rst
│   │   ├── espaloma.mm.energy.apply_bond_ii.rst
│   │   ├── espaloma.mm.energy.apply_bond_linear_mixture.rst
│   │   ├── espaloma.mm.energy.apply_improper_torsion.rst
│   │   ├── espaloma.mm.energy.apply_nonbonded.rst
│   │   ├── espaloma.mm.energy.apply_torsion.rst
│   │   ├── espaloma.mm.energy.apply_torsion_ii.rst
│   │   ├── espaloma.mm.energy.energy_in_graph.rst
│   │   ├── espaloma.mm.energy.energy_in_graph_ii.rst
│   │   ├── espaloma.mm.energy.rst
│   │   ├── espaloma.mm.functional.gaussian.rst
│   │   ├── espaloma.mm.functional.harmonic.rst
│   │   ├── espaloma.mm.functional.harmonic_harmonic_coupled.rst
│   │   ├── espaloma.mm.functional.harmonic_harmonic_periodic_coupled.rst
│   │   ├── espaloma.mm.functional.harmonic_periodic_coupled.rst
│   │   ├── espaloma.mm.functional.linear_mixture.rst
│   │   ├── espaloma.mm.functional.linear_mixture_to_original.rst
│   │   ├── espaloma.mm.functional.lj.rst
│   │   ├── espaloma.mm.functional.periodic.rst
│   │   ├── espaloma.mm.functional.periodic_fixed_phases.rst
│   │   ├── espaloma.mm.functional.rst
│   │   ├── espaloma.mm.geometry.GeometryInGraph.rst
│   │   ├── espaloma.mm.geometry.angle.rst
│   │   ├── espaloma.mm.geometry.apply_angle.rst
│   │   ├── espaloma.mm.geometry.apply_bond.rst
│   │   ├── espaloma.mm.geometry.apply_torsion.rst
│   │   ├── espaloma.mm.geometry.copy_src.rst
│   │   ├── espaloma.mm.geometry.dihedral.rst
│   │   ├── espaloma.mm.geometry.distance.rst
│   │   ├── espaloma.mm.geometry.geometry_in_graph.rst
│   │   ├── espaloma.mm.geometry.reduce_stack.rst
│   │   ├── espaloma.mm.geometry.rst
│   │   ├── espaloma.mm.nonbonded.arithmetic_mean.rst
│   │   ├── espaloma.mm.nonbonded.geometric_mean.rst
│   │   ├── espaloma.mm.nonbonded.lj_12_6.rst
│   │   ├── espaloma.mm.nonbonded.lj_9_6.rst
│   │   ├── espaloma.mm.nonbonded.lorentz_berthelot.rst
│   │   ├── espaloma.mm.nonbonded.rst
│   │   ├── espaloma.mm.rst
│   │   ├── espaloma.mm.torsion.angle_angle.rst
│   │   ├── espaloma.mm.torsion.angle_angle_torsion.rst
│   │   ├── espaloma.mm.torsion.angle_torsion.rst
│   │   ├── espaloma.mm.torsion.bond_torsion.rst
│   │   ├── espaloma.mm.torsion.periodic_torsion.rst
│   │   ├── espaloma.mm.torsion.rst
│   │   ├── espaloma.nn.baselines.FreeParameterBaseline.rst
│   │   ├── espaloma.nn.baselines.FreeParameterBaselineInitMean.rst
│   │   ├── espaloma.nn.baselines.rst
│   │   ├── espaloma.nn.layers.dgl_legacy.GN.rst
│   │   ├── espaloma.nn.layers.dgl_legacy.rst
│   │   ├── espaloma.nn.layers.rst
│   │   ├── espaloma.nn.readout.base_readout.BaseReadout.rst
│   │   ├── espaloma.nn.readout.base_readout.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.ChargeEquilibrium.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.get_charges.rst
│   │   ├── espaloma.nn.readout.charge_equilibrium.rst
│   │   ├── espaloma.nn.readout.graph_level_readout.GraphLevelReadout.rst
│   │   ├── espaloma.nn.readout.graph_level_readout.rst
│   │   ├── espaloma.nn.readout.janossy.ExpCoefficients.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPooling.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPoolingImproper.rst
│   │   ├── espaloma.nn.readout.janossy.JanossyPoolingNonbonded.rst
│   │   ├── espaloma.nn.readout.janossy.LinearMixtureToOriginal.rst
│   │   ├── espaloma.nn.readout.janossy.rst
│   │   ├── espaloma.nn.readout.node_typing.NodeTyping.rst
│   │   ├── espaloma.nn.readout.node_typing.rst
│   │   ├── espaloma.nn.readout.rst
│   │   ├── espaloma.nn.rst
│   │   ├── espaloma.nn.sequential.Sequential.rst
│   │   └── espaloma.nn.sequential.rst
│   ├── conf.py
│   ├── deploy.rst
│   ├── download_experiments.sh
│   ├── experiments/
│   │   ├── index.rst
│   │   ├── mm_fitting_small.rst
│   │   ├── qm_fitting.rst
│   │   └── typing.rst
│   ├── index.rst
│   ├── install.rst
│   ├── make.bat
│   └── qm_fitting.rst
├── espaloma/
│   ├── .py
│   ├── __init__.py
│   ├── _version.py
│   ├── app/
│   │   ├── __init__.py
│   │   ├── experiment.py
│   │   ├── report.py
│   │   ├── tests/
│   │   │   └── test_experiment.py
│   │   ├── train.py
│   │   ├── train_all_params.py
│   │   ├── train_bonded_energy.py
│   │   └── train_multi_typing.py
│   ├── data/
│   │   ├── __init__.py
│   │   ├── collection.py
│   │   ├── dataset.py
│   │   ├── md.py
│   │   ├── md17_utils.py
│   │   ├── normalize.py
│   │   ├── off-mol_0_10_6.json
│   │   ├── qcarchive_utils.py
│   │   ├── tests/
│   │   │   ├── test_collection.py
│   │   │   ├── test_dataset.py
│   │   │   ├── test_md.py
│   │   │   ├── test_normalize.py
│   │   │   ├── test_qcarchive.py
│   │   │   └── test_save_and_load.py
│   │   └── utils.py
│   ├── graphs/
│   │   ├── __init__.py
│   │   ├── deploy.py
│   │   ├── graph.py
│   │   ├── legacy_force_field.py
│   │   ├── tests/
│   │   │   ├── test_deploy.py
│   │   │   ├── test_gaff_parametrize.py
│   │   │   ├── test_graph.py
│   │   │   └── test_smirnoff.py
│   │   └── utils/
│   │       ├── __init__.py
│   │       ├── offmol_indices.py
│   │       ├── read_heterogeneous_graph.py
│   │       ├── read_homogeneous_graph.py
│   │       └── regenerate_impropers.py
│   ├── metrics.py
│   ├── mm/
│   │   ├── __init__.py
│   │   ├── angle.py
│   │   ├── bond.py
│   │   ├── energy.py
│   │   ├── functional.py
│   │   ├── geometry.py
│   │   ├── nonbonded.py
│   │   ├── tests/
│   │   │   ├── system.xml
│   │   │   ├── test_angle.py
│   │   │   ├── test_angle_energy.py
│   │   │   ├── test_bond_energy.py
│   │   │   ├── test_charge_energy_consistency.py
│   │   │   ├── test_charge_energy_consistency_hardcode.py
│   │   │   ├── test_dihedral.py
│   │   │   ├── test_distance.py
│   │   │   ├── test_energy.py
│   │   │   ├── test_energy_gaussian.py
│   │   │   ├── test_energy_ii.py
│   │   │   ├── test_geometry.py
│   │   │   ├── test_linear_combination.py
│   │   │   ├── test_openmm_consistency.py
│   │   │   └── test_recoverability.py
│   │   └── torsion.py
│   ├── nn/
│   │   ├── __init__.py
│   │   ├── baselines.py
│   │   ├── layers/
│   │   │   ├── __init__.py
│   │   │   └── dgl_legacy.py
│   │   ├── readout/
│   │   │   ├── __init__.py
│   │   │   ├── base_readout.py
│   │   │   ├── charge_equilibrium.py
│   │   │   ├── graph_level_readout.py
│   │   │   ├── janossy.py
│   │   │   └── node_typing.py
│   │   ├── sequential.py
│   │   └── tests/
│   │       ├── test_baseline.py
│   │       ├── test_janossy.py
│   │       └── test_simple_net.py
│   ├── units.py
│   └── utils/
│       ├── geometry.py
│       ├── model_fetch.py
│       └── tests/
│           └── test_model_fetch.py
├── requirements.txt
├── scripts/
│   ├── README.md
│   └── perses-benchmark/
│       ├── README.md
│       ├── espaloma-perses.export.yaml
│       ├── espaloma-perses.yaml
│       └── tyk2/
│           ├── README.md
│           ├── espaloma-0.2.2/
│           │   ├── LSF-job-template.sh
│           │   ├── README.md
│           │   ├── benchmark_analysis.py
│           │   ├── run_benchmarks.py
│           │   └── template.yaml
│           └── openff-1.2.0/
│               ├── LSF-job-template.sh
│               ├── README.md
│               ├── benchmark_analysis.py
│               ├── run_benchmarks.py
│               └── template.yaml
├── setup.cfg
├── setup.py
└── versioneer.py
Download .txt
SYMBOL INDEX (455 symbols across 73 files)

FILE: devtools/scripts/create_conda_env.py
  function temp_cd (line 38) | def temp_cd():

FILE: espaloma/_version.py
  function get_keywords (line 23) | def get_keywords() -> Dict[str, str]:
  class VersioneerConfig (line 36) | class VersioneerConfig:
  function get_config (line 47) | def get_config() -> VersioneerConfig:
  class NotThisMethod (line 61) | class NotThisMethod(Exception):
  function register_vcs_handler (line 69) | def register_vcs_handler(vcs: str, method: str) -> Callable:  # decorator
  function run_command (line 80) | def run_command(
  function versions_from_parentdir (line 128) | def versions_from_parentdir(
  function git_get_keywords (line 157) | def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
  function git_versions_from_keywords (line 185) | def git_versions_from_keywords(
  function git_pieces_from_vcs (line 253) | def git_pieces_from_vcs(
  function plus_or_dot (line 390) | def plus_or_dot(pieces: Dict[str, Any]) -> str:
  function render_pep440 (line 397) | def render_pep440(pieces: Dict[str, Any]) -> str:
  function render_pep440_branch (line 422) | def render_pep440_branch(pieces: Dict[str, Any]) -> str:
  function pep440_split_post (line 452) | def pep440_split_post(ver: str) -> Tuple[str, Optional[int]]:
  function render_pep440_pre (line 462) | def render_pep440_pre(pieces: Dict[str, Any]) -> str:
  function render_pep440_post (line 486) | def render_pep440_post(pieces: Dict[str, Any]) -> str:
  function render_pep440_post_branch (line 513) | def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
  function render_pep440_old (line 542) | def render_pep440_old(pieces: Dict[str, Any]) -> str:
  function render_git_describe (line 564) | def render_git_describe(pieces: Dict[str, Any]) -> str:
  function render_git_describe_long (line 584) | def render_git_describe_long(pieces: Dict[str, Any]) -> str:
  function render (line 604) | def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
  function get_versions (line 640) | def get_versions() -> Dict[str, Any]:

FILE: espaloma/app/experiment.py
  class Experiment (line 14) | class Experiment(abc.ABC):
    method __init__ (line 17) | def __init__(self):
  class Train (line 21) | class Train(Experiment):
    method __init__ (line 55) | def __init__(
    method train_once (line 101) | def train_once(self):
    method train (line 133) | def train(self):
  class Test (line 153) | class Test(Experiment):
    method __init__ (line 172) | def __init__(
    method test (line 191) | def test(self):
  class TrainAndTest (line 251) | class TrainAndTest(Experiment):
    method __init__ (line 254) | def __init__(
    method __str__ (line 284) | def __str__(self):
    method run (line 305) | def run(self):

FILE: espaloma/app/report.py
  function dataframe (line 11) | def dataframe(results_dict):
  function curve (line 26) | def curve(results_dict):
  function markdown (line 54) | def markdown(results_dict):
  function visual (line 59) | def visual(results_dict):
  function visual_multiple (line 105) | def visual_multiple(results_dicts):
  function visual_base64 (line 169) | def visual_base64(results_dict):
  function html (line 182) | def html(results_dict):
  function html_multiple_train_and_test (line 210) | def html_multiple_train_and_test(results):
  function html_multiple_train_and_test_2d_grid (line 220) | def html_multiple_train_and_test_2d_grid(results):

FILE: espaloma/app/tests/test_experiment.py
  function test_import (line 5) | def test_import():
  function data (line 12) | def data():
  function net (line 25) | def net():
  function test_data_and_net (line 46) | def test_data_and_net(data, net):
  function train (line 52) | def train(data, net):
  function test_train (line 70) | def test_train(train):
  function test_test (line 74) | def test_test(train, net, data):
  function test_train_and_test (line 81) | def test_train_and_test(net, data):

FILE: espaloma/app/train.py
  function run (line 13) | def run(args):

FILE: espaloma/app/train_all_params.py
  function run (line 11) | def run(args):

FILE: espaloma/app/train_bonded_energy.py
  function run (line 13) | def run(args):

FILE: espaloma/app/train_multi_typing.py
  function run (line 10) | def run(args):

FILE: espaloma/data/collection.py
  function esol (line 10) | def esol(*args, **kwargs):
  function alkethoh (line 29) | def alkethoh(*args, **kwargs):
  function zinc (line 66) | def zinc(first=-1, *args, **kwargs):
  function md17_old (line 114) | def md17_old(*args, **kwargs):
  function md17_new (line 132) | def md17_new(*args, **kwargs):
  class qca (line 144) | class qca(object):
  function _get_ds (line 159) | def _get_ds(cls, df_name):

FILE: espaloma/data/dataset.py
  class Dataset (line 14) | class Dataset(abc.ABC, torch.utils.data.Dataset):
    method __init__ (line 59) | def __init__(self, graphs=None):
    method __len__ (line 64) | def __len__(self):
    method __getitem__ (line 72) | def __getitem__(self, idx):
    method __iter__ (line 123) | def __iter__(self):
    method shuffle (line 136) | def shuffle(self, seed=None):
    method apply (line 146) | def apply(self, fn, in_place=False):
    method split (line 180) | def split(self, partition):
    method subsample (line 202) | def subsample(self, ratio, seed=None):
    method save (line 220) | def save(self, path):
    method regenerate_impropers (line 232) | def regenerate_impropers(self, improper_def="smirnoff"):
    method load (line 249) | def load(cls, path):
    method __add__ (line 262) | def __add__(self, x):
  class GraphDataset (line 266) | class GraphDataset(Dataset):
    method __init__ (line 278) | def __init__(self, graphs=[], first=None):
    method batch (line 296) | def batch(graphs):
    method view (line 314) | def view(self, collate_fn="graph", *args, **kwargs):
    method save (line 355) | def save(self, path):
    method load (line 363) | def load(cls, path):

FILE: espaloma/data/md.py
  function add_nonbonded_force (line 28) | def add_nonbonded_force(
  function get_coulomb_force (line 181) | def get_coulomb_force(
  function subtract_coulomb_force (line 320) | def subtract_coulomb_force(
  function subtract_nonbonded_force (line 346) | def subtract_nonbonded_force(
  function subtract_nonbonded_force_except_14 (line 508) | def subtract_nonbonded_force_except_14(
  class MoleculeVacuumSimulation (line 663) | class MoleculeVacuumSimulation(object):
    method __init__ (line 694) | def __init__(
    method simulation_from_graph (line 715) | def simulation_from_graph(self, g):
    method run (line 762) | def run(self, g, in_place=True):

FILE: espaloma/data/md17_utils.py
  function sum_offsets (line 36) | def sum_offsets(elements):
  function realize_molecule (line 40) | def realize_molecule(
  function get_molecule (line 84) | def get_molecule(name, *args, **kwargs):

FILE: espaloma/data/normalize.py
  class BaseNormalize (line 14) | class BaseNormalize(abc.ABC):
    method __init__ (line 17) | def __init__(self):
    method _prepare (line 21) | def _prepare(self):
  class DatasetNormalNormalize (line 30) | class DatasetNormalNormalize(BaseNormalize):
    method __init__ (line 48) | def __init__(self, dataset):
    method _prepare (line 53) | def _prepare(self):
  class DatasetLogNormalNormalize (line 122) | class DatasetLogNormalNormalize(BaseNormalize):
    method __init__ (line 140) | def __init__(self, dataset):
    method _prepare (line 145) | def _prepare(self):
  class ESOL100NormalNormalize (line 222) | class ESOL100NormalNormalize(DatasetNormalNormalize):
    method __init__ (line 223) | def __init__(self):
  class ESOL100LogNormalNormalize (line 234) | class ESOL100LogNormalNormalize(DatasetLogNormalNormalize):
    method __init__ (line 235) | def __init__(self):
  class NotNormalize (line 246) | class NotNormalize(BaseNormalize):
    method __init__ (line 247) | def __init__(self):
    method _prepare (line 251) | def _prepare(self):
  class PositiveNotNormalize (line 256) | class PositiveNotNormalize(BaseNormalize):
    method __init__ (line 257) | def __init__(self):
    method _prepare (line 261) | def _prepare(self):

FILE: espaloma/data/qcarchive_utils.py
  function get_client (line 24) | def get_client(url: str = "api.qcarchive.molssi.org") -> qcportal.client...
  function get_collection (line 42) | def get_collection(
  function process_record (line 76) | def process_record(record, entry):
  function get_graph (line 149) | def get_graph(collection, record_name, spec_name="default"):
  function get_graphs (line 176) | def get_graphs(collection, record_names, spec_name="default"):
  function fetch_td_record (line 211) | def fetch_td_record(record: qcportal.torsiondrive.record_models.Torsiond...
  function h5_to_dataset (line 283) | def h5_to_dataset(df):
  function breakdown_along_time_axis (line 338) | def breakdown_along_time_axis(g, batch_size=32):
  function make_batch_size_consistent (line 369) | def make_batch_size_consistent(ds, batch_size=32):
  function weight_by_snapshots (line 381) | def weight_by_snapshots(g, key="weight"):

FILE: espaloma/data/tests/test_collection.py
  function esol (line 5) | def esol():
  function test_view (line 11) | def test_view(esol):
  function test_typing (line 20) | def test_typing(esol):

FILE: espaloma/data/tests/test_dataset.py
  function test_tiny_dataset (line 4) | def test_tiny_dataset():
  function ds (line 12) | def ds():
  function test_get (line 19) | def test_get(ds):
  function test_len (line 23) | def test_len(ds):
  function test_iter (line 27) | def test_iter(ds):
  function test_slice (line 31) | def test_slice(ds):
  function test_split (line 39) | def test_split(ds):
  function ds_new (line 46) | def ds_new(ds):
  function test_no_change (line 51) | def test_no_change(ds_new):
  function test_get_new (line 55) | def test_get_new(ds_new):
  function test_len_new (line 59) | def test_len_new(ds_new):
  function test_iter_new (line 63) | def test_iter_new(ds_new):
  function ds_newer (line 68) | def ds_newer(ds):
  function test_iter_newer (line 73) | def test_iter_newer(ds_newer):
  function test_no_return (line 77) | def test_no_return(ds):
  function test_subsample (line 83) | def test_subsample(ds):

FILE: espaloma/data/tests/test_md.py
  function test_init (line 5) | def test_init():
  function graph (line 10) | def graph():
  function ds (line 18) | def ds():
  function test_system (line 25) | def test_system(graph):
  function test_run (line 31) | def test_run(graph):
  function test_run_in_place (line 41) | def test_run_in_place(graph):
  function test_apply (line 51) | def test_apply(ds):

FILE: espaloma/data/tests/test_normalize.py
  function test_import (line 5) | def test_import():
  function test_normalize_esol (line 9) | def test_normalize_esol():
  function test_log_normalize_esol (line 22) | def test_log_normalize_esol():
  function test_normal_normalize_reproduce (line 35) | def test_normal_normalize_reproduce():
  function test_log_normal_normalize_reproduce (line 79) | def test_log_normal_normalize_reproduce():

FILE: espaloma/data/tests/test_qcarchive.py
  function test_import (line 4) | def test_import():
  function test_get_graph (line 8) | def test_get_graph():
  function test_notsupported_dataset (line 30) | def test_notsupported_dataset():
  function test_get_torsiondrive (line 44) | def test_get_torsiondrive():

FILE: espaloma/data/tests/test_save_and_load.py
  function test_save_and_load (line 4) | def test_save_and_load():

FILE: espaloma/data/utils.py
  function make_temp_directory (line 26) | def make_temp_directory():
  function sum_offsets (line 36) | def sum_offsets(elements):
  function from_csv (line 40) | def from_csv(path, toolkit="rdkit", smiles_col=-1, y_cols=[-2], seed=2666):
  function normalize (line 73) | def normalize(ds):
  function split (line 89) | def split(ds, partition):
  function batch (line 105) | def batch(ds, batch_size, seed=2666):
  function collate_fn (line 130) | def collate_fn(graphs):
  function infer_mol_from_coordinates (line 136) | def infer_mol_from_coordinates(

FILE: espaloma/graphs/deploy.py
  function load_forcefield (line 32) | def load_forcefield(forcefield="openff_unconstrained-2.2.1"):
  function openmm_system_from_graph (line 42) | def openmm_system_from_graph(

FILE: espaloma/graphs/graph.py
  class BaseGraph (line 14) | class BaseGraph(abc.ABC):
    method __init__ (line 17) | def __init__(self):
  class Graph (line 21) | class Graph(BaseGraph):
    method __init__ (line 48) | def __init__(self, mol=None, homograph=None, heterograph=None):
    method save (line 70) | def save(self, path):
    method load (line 82) | def load(cls, path):
    method get_homograph_from_mol (line 110) | def get_homograph_from_mol(mol):
    method get_heterograph_from_graph_and_mol (line 129) | def get_heterograph_from_graph_and_mol(graph, mol):
    method ndata (line 156) | def ndata(self):
    method edata (line 160) | def edata(self):
    method nodes (line 164) | def nodes(self):

FILE: espaloma/graphs/legacy_force_field.py
  class LegacyForceField (line 36) | class LegacyForceField:
    method __init__ (line 54) | def __init__(self, forcefield="gaff-1.81"):
    method _convert_to_off (line 59) | def _convert_to_off(mol):
    method _prepare_forcefield (line 72) | def _prepare_forcefield(self):
    method _prepare_openff (line 87) | def _prepare_openff(self):
    method _prepare_smirnoff (line 93) | def _prepare_smirnoff(self):
    method _prepare_gaff (line 99) | def _prepare_gaff(self):
    method _type_gaff (line 137) | def _type_gaff(self, g):
    method _parametrize_gaff (line 188) | def _parametrize_gaff(self, g, n_max_phases=6):
    method _parametrize_smirnoff (line 430) | def _parametrize_smirnoff(self, g):
    method baseline_energy (line 613) | def baseline_energy(self, g, suffix=None):
    method _multi_typing_smirnoff (line 667) | def _multi_typing_smirnoff(self, g):
    method parametrize (line 718) | def parametrize(self, g):
    method typing (line 729) | def typing(self, g):
    method multi_typing (line 737) | def multi_typing(self, g):
    method __call__ (line 745) | def __call__(self, *args, **kwargs):

FILE: espaloma/graphs/tests/test_deploy.py
  function test_butane_charge_am1bcc (line 12) | def test_butane_charge_am1bcc():
  function test_butane_charge_nn (line 20) | def test_butane_charge_nn():
  function test_caffeine (line 38) | def test_caffeine():
  function test_parameter_consistent_caffeine (line 48) | def test_parameter_consistent_caffeine():
  function test_energy_consistent_caffeine (line 71) | def test_energy_consistent_caffeine():

FILE: espaloma/graphs/tests/test_gaff_parametrize.py
  function test_gaff_parametrize (line 5) | def test_gaff_parametrize():

FILE: espaloma/graphs/tests/test_graph.py
  function test_graph (line 9) | def test_graph():
  function graph (line 18) | def graph():
  function test_ndata_consistency (line 24) | def test_ndata_consistency(graph):
  function test_formal_charge (line 38) | def test_formal_charge(molecule, charge):
  function test_save_and_load (line 45) | def test_save_and_load(graph):
  function test_load_from_older_openff (line 56) | def test_load_from_older_openff(tmp_path_factory):

FILE: espaloma/graphs/tests/test_smirnoff.py
  function test_smirnoff_esol_first (line 6) | def test_smirnoff_esol_first():

FILE: espaloma/graphs/utils/offmol_indices.py
  function atom_indices (line 5) | def atom_indices(offmol: Molecule) -> np.ndarray:
  function bond_indices (line 9) | def bond_indices(offmol: Molecule) -> np.ndarray:
  function angle_indices (line 13) | def angle_indices(offmol: Molecule) -> np.ndarray:
  function proper_torsion_indices (line 24) | def proper_torsion_indices(offmol: Molecule) -> np.ndarray:
  function _all_improper_torsion_indices (line 35) | def _all_improper_torsion_indices(offmol: Molecule) -> np.ndarray:
  function improper_torsion_indices (line 48) | def improper_torsion_indices(

FILE: espaloma/graphs/utils/read_heterogeneous_graph.py
  function duplicate_index_ordering (line 18) | def duplicate_index_ordering(indices: np.ndarray) -> np.ndarray:
  function relationship_indices_from_offmol (line 33) | def relationship_indices_from_offmol(
  function from_homogeneous_and_mol (line 70) | def from_homogeneous_and_mol(g, offmol):

FILE: espaloma/graphs/utils/read_homogeneous_graph.py
  function fp_oe (line 14) | def fp_oe(atom):
  function fp_rdkit (line 64) | def fp_rdkit(atom):
  function from_openff_toolkit_mol (line 123) | def from_openff_toolkit_mol(mol, use_fp=True):
  function from_oemol (line 172) | def from_oemol(mol, use_fp=True):
  function from_rdkit_mol (line 216) | def from_rdkit_mol(mol, use_fp=True):

FILE: espaloma/graphs/utils/regenerate_impropers.py
  function regenerate_impropers (line 9) | def regenerate_impropers(g: Graph, improper_def="smirnoff"):

FILE: espaloma/metrics.py
  function center (line 16) | def center(metric, dim=1, reduction="none"):
  function boltzmann_weighted (line 32) | def boltzmann_weighted(metric, reduction="mean", temperature=300.0):
  function std (line 51) | def std(metric, weight=1.0, dim=1):
  function weighted (line 58) | def weighted(metric, weight, reduction="mean"):
  function weighted_with_key (line 70) | def weighted_with_key(metric, key="weight", reduction="mean"):
  function bootstrap (line 81) | def bootstrap(metric, n_samples=100, ci=0.95):
  function latex_format_ci (line 116) | def latex_format_ci(original, low, high):
  function mse (line 123) | def mse(input, target):
  function mape (line 127) | def mape(input, target):
  function rmse (line 131) | def rmse(input, target):
  function mae_of_log (line 135) | def mae_of_log(input, target):
  function cross_entropy (line 139) | def cross_entropy(input, target, reduction="mean"):
  function r2 (line 144) | def r2(input, target):
  function accuracy (line 152) | def accuracy(input, target):
  class Metric (line 163) | class Metric(torch.nn.modules.loss._Loss):
    method __init__ (line 166) | def __init__(self, size_average=None, reduce=None, reduction="mean"):
    method forward (line 170) | def forward(self, *args, **kwargs):
  class GraphMetric (line 174) | class GraphMetric(Metric):
    method __init__ (line 193) | def __init__(self, base_metric, between, level="n1", *args, **kwargs):
    method _translation (line 220) | def _translation(string, level):
    method forward (line 223) | def forward(self, g_input, g_target=None):
  class GraphDerivativeMetric (line 240) | class GraphDerivativeMetric(Metric):
    method __init__ (line 243) | def __init__(
    method _translation (line 284) | def _translation(string, level):
    method forward (line 287) | def forward(self, g_input, g_target=None):
  class GraphHalfDerivativeMetric (line 322) | class GraphHalfDerivativeMetric(Metric):
    method __init__ (line 325) | def __init__(
    method _translation (line 365) | def _translation(string, level):
    method forward (line 368) | def forward(self, g_input, g_target=None):
  class TypingCrossEntropy (line 398) | class TypingCrossEntropy(GraphMetric):
    method __init__ (line 399) | def __init__(self):
  class TypingAccuracy (line 408) | class TypingAccuracy(GraphMetric):
    method __init__ (line 409) | def __init__(self):
  class BondKMSE (line 417) | class BondKMSE(GraphMetric):
    method __init__ (line 418) | def __init__(self):
  class BondKRMSE (line 426) | class BondKRMSE(GraphMetric):
    method __init__ (line 427) | def __init__(self):

FILE: espaloma/mm/angle.py
  function harmonic_angle (line 10) | def harmonic_angle(x, k, eq):
  function linear_mixture_angle (line 36) | def linear_mixture_angle(x, coefficients, phases):
  function urey_bradley (line 54) | def urey_bradley(x_between, coefficients, phases):
  function bond_bond (line 62) | def bond_bond(u_left, u_right, k_bond_bond):
  function bond_angle (line 68) | def bond_angle(
  function angle_high (line 83) | def angle_high(

FILE: espaloma/mm/bond.py
  function harmonic_bond (line 10) | def harmonic_bond(x, k, eq):
  function gaussian_bond (line 36) | def gaussian_bond(x, coefficients):
  function linear_mixture_bond (line 44) | def linear_mixture_bond(x, coefficients, phases):
  function bond_high (line 61) | def bond_high(u_bond, k3, k4):

FILE: espaloma/mm/energy.py
  function apply_bond (line 12) | def apply_bond(nodes, suffix=""):
  function apply_angle (line 34) | def apply_angle(nodes, suffix=""):
  function apply_angle_ii (line 46) | def apply_angle_ii(nodes, suffix=""):
  function apply_bond_ii (line 76) | def apply_bond_ii(nodes, suffix=""):
  function apply_torsion_ii (line 87) | def apply_torsion_ii(nodes, suffix=""):
  function apply_torsion (line 122) | def apply_torsion(nodes, suffix=""):
  function apply_improper_torsion (line 148) | def apply_improper_torsion(nodes, suffix=""):
  function apply_bond_gaussian (line 179) | def apply_bond_gaussian(nodes, suffix=""):
  function apply_bond_linear_mixture (line 191) | def apply_bond_linear_mixture(nodes, suffix="", phases=[0.0, 1.0]):
  function apply_angle_linear_mixture (line 204) | def apply_angle_linear_mixture(nodes, suffix="", phases=[0.0, 1.0]):
  function apply_nonbonded (line 220) | def apply_nonbonded(nodes, scaling=1.0, suffix=""):
  function apply_coulomb (line 234) | def apply_coulomb(nodes, scaling=1.0, suffix=""):
  function energy_in_graph (line 248) | def energy_in_graph(
  function energy_in_graph_ii (line 396) | def energy_in_graph_ii(
  class EnergyInGraph (line 437) | class EnergyInGraph(torch.nn.Module):
    method __init__ (line 438) | def __init__(self, *args, **kwargs):
    method forward (line 443) | def forward(self, g):
  class EnergyInGraphII (line 447) | class EnergyInGraphII(torch.nn.Module):
    method __init__ (line 448) | def __init__(self, *args, **kwargs):
    method forward (line 453) | def forward(self, g):
  class CarryII (line 457) | class CarryII(torch.nn.Module):
    method forward (line 458) | def forward(self, g):

FILE: espaloma/mm/functional.py
  function linear_mixture_to_original (line 21) | def linear_mixture_to_original(k1, k2, b1, b2):
  function harmonic (line 37) | def harmonic(x, k, eq, order=[2]):
  function periodic_fixed_phases (line 62) | def periodic_fixed_phases(
  function periodic (line 124) | def periodic(
  function lj (line 203) | def lj(
  function gaussian (line 260) | def gaussian(x, coefficients, phases=[idx * 0.001 for idx in range(200)]):
  function linear_mixture (line 283) | def linear_mixture(x, coefficients, phases=[0.0, 1.0]):
  function harmonic_periodic_coupled (line 316) | def harmonic_periodic_coupled(
  function harmonic_harmonic_coupled (line 351) | def harmonic_harmonic_coupled(
  function harmonic_harmonic_periodic_coupled (line 362) | def harmonic_harmonic_periodic_coupled(

FILE: espaloma/mm/geometry.py
  function reduce_stack (line 9) | def reduce_stack(msg, out):
  function copy_src (line 18) | def copy_src(src, out):
  function distance (line 30) | def distance(x0, x1):
  function _angle (line 35) | def _angle(r0, r1):
  function angle (line 46) | def angle(x0, x1, x2):
  function _dihedral (line 53) | def _dihedral(r0, r1):
  function dihedral (line 58) | def dihedral(
  function apply_bond (line 95) | def apply_bond(nodes):
  function apply_angle (line 101) | def apply_angle(nodes):
  function apply_torsion (line 124) | def apply_torsion(nodes):
  function geometry_in_graph (line 165) | def geometry_in_graph(g):
  class GeometryInGraph (line 245) | class GeometryInGraph(torch.nn.Module):
    method __init__ (line 246) | def __init__(self, *args, **kwargs):
    method forward (line 251) | def forward(self, g):

FILE: espaloma/mm/nonbonded.py
  function geometric_mean (line 27) | def geometric_mean(msg="m", out="epsilon"):
  function arithmetic_mean (line 34) | def arithmetic_mean(msg="m", out="sigma"):
  function lorentz_berthelot (line 44) | def lorentz_berthelot(g, suffix=""):
  function multiply_charges (line 78) | def multiply_charges(g, suffix=""):
  function lj_12_6 (line 114) | def lj_12_6(x, sigma, epsilon):
  function lj_9_6 (line 135) | def lj_9_6(x, sigma, epsilon):
  function coulomb (line 158) | def coulomb(x, q, k_e=K_E):

FILE: espaloma/mm/tests/test_angle.py
  function test_angle_random_vectors (line 7) | def test_angle_random_vectors():
  function test_angle_random_points (line 31) | def test_angle_random_points():
  function test_zero (line 54) | def test_zero():

FILE: espaloma/mm/tests/test_angle_energy.py
  function test_energy_angle_and_bond (line 18) | def test_energy_angle_and_bond():

FILE: espaloma/mm/tests/test_bond_energy.py
  function test_multiple_conformation (line 4) | def test_multiple_conformation():

FILE: espaloma/mm/tests/test_charge_energy_consistency.py
  function test_coulomb_energy_consistency (line 14) | def test_coulomb_energy_consistency(g):

FILE: espaloma/mm/tests/test_charge_energy_consistency_hardcode.py
  function test_coulomb_energy_consistency (line 15) | def test_coulomb_energy_consistency(g):

FILE: espaloma/mm/tests/test_dihedral.py
  function test_dihedral_vectors (line 11) | def test_dihedral_vectors():
  function test_dihedral_points (line 28) | def test_dihedral_points():

FILE: espaloma/mm/tests/test_distance.py
  function test_distance (line 7) | def test_distance():

FILE: espaloma/mm/tests/test_energy.py
  function test_import (line 7) | def test_import():
  function test_energy (line 11) | def test_energy():

FILE: espaloma/mm/tests/test_energy_ii.py
  function test_energy (line 7) | def test_energy():

FILE: espaloma/mm/tests/test_geometry.py
  function test_import (line 8) | def test_import():
  function all_g (line 24) | def all_g():
  function test_geometry_can_be_computed_without_exceptions (line 41) | def test_geometry_can_be_computed_without_exceptions(all_g):
  function test_geometry_n_terms (line 46) | def test_geometry_n_terms(all_g):

FILE: espaloma/mm/tests/test_linear_combination.py
  function test_linear_combination (line 4) | def test_linear_combination():
  function test_consistency (line 25) | def test_consistency():

FILE: espaloma/mm/tests/test_openmm_consistency.py
  function _create_torsion_sim (line 20) | def _create_torsion_sim(
  function test_periodic_torsion (line 49) | def test_periodic_torsion(
  function test_energy_angle_and_bond (line 100) | def test_energy_angle_and_bond(g):

FILE: espaloma/mm/tests/test_recoverability.py
  function _create_impropers_only_system (line 14) | def _create_impropers_only_system(
  function test_improper_recover (line 75) | def test_improper_recover():

FILE: espaloma/mm/torsion.py
  function periodic_torsion (line 10) | def periodic_torsion(
  function angle_angle (line 45) | def angle_angle(
  function angle_torsion (line 58) | def angle_torsion(
  function angle_angle_torsion (line 74) | def angle_angle_torsion(
  function bond_torsion (line 92) | def bond_torsion(

FILE: espaloma/nn/baselines.py
  class FreeParameterBaseline (line 10) | class FreeParameterBaseline(torch.nn.Module):
    method __init__ (line 17) | def __init__(self, g_ref):
    method forward (line 36) | def forward(self, g):
  class FreeParameterBaselineInitMean (line 60) | class FreeParameterBaselineInitMean(torch.nn.Module):
    method __init__ (line 66) | def __init__(self, g_ref):
    method forward (line 86) | def forward(self, g):

FILE: espaloma/nn/layers/dgl_legacy.py
  class GN (line 23) | class GN(torch.nn.Module):
    method __init__ (line 24) | def __init__(
    method forward (line 46) | def forward(self, g, x):
  function gn (line 55) | def gn(model_name="GraphConv", kwargs={}):

FILE: espaloma/nn/readout/base_readout.py
  class BaseReadout (line 12) | class BaseReadout(abc.ABC, torch.nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 19) | def forward(self, g, x=None, *args, **kwargs):
    method _forward (line 22) | def _forward(self, g, x, *args, **kwargs):

FILE: espaloma/nn/readout/charge_equilibrium.py
  function get_charges (line 12) | def get_charges(node):
  class ChargeEquilibrium (line 59) | class ChargeEquilibrium(torch.nn.Module):
    method __init__ (line 62) | def __init__(self):
    method forward (line 65) | def forward(self, g, total_charge=0.0):

FILE: espaloma/nn/readout/graph_level_readout.py
  class GraphLevelReadout (line 10) | class GraphLevelReadout(torch.nn.Module):
    method __init__ (line 13) | def __init__(
    method forward (line 47) | def forward(self, g):

FILE: espaloma/nn/readout/janossy.py
  class JanossyPooling (line 12) | class JanossyPooling(torch.nn.Module):
    method __init__ (line 19) | def __init__(
    method forward (line 92) | def forward(self, g):
  class JanossyPoolingImproper (line 176) | class JanossyPoolingImproper(torch.nn.Module):
    method __init__ (line 183) | def __init__(
    method forward (line 228) | def forward(self, g):
  class JanossyPoolingWithSmirnoffImproper (line 296) | class JanossyPoolingWithSmirnoffImproper(torch.nn.Module):
    method __init__ (line 301) | def __init__(
    method forward (line 346) | def forward(self, g):
  class JanossyPoolingNonbonded (line 414) | class JanossyPoolingNonbonded(torch.nn.Module):
    method __init__ (line 421) | def __init__(
    method forward (line 464) | def forward(self, g):
  class ExpCoefficients (line 533) | class ExpCoefficients(torch.nn.Module):
    method forward (line 534) | def forward(self, g):
  class LinearMixtureToOriginal (line 546) | class LinearMixtureToOriginal(torch.nn.Module):
    method forward (line 547) | def forward(self, g):

FILE: espaloma/nn/readout/node_typing.py
  class NodeTyping (line 12) | class NodeTyping(BaseReadout):
    method __init__ (line 15) | def __init__(self, in_features, n_classes=100):
    method forward (line 19) | def forward(self, g):

FILE: espaloma/nn/sequential.py
  class _Sequential (line 6) | class _Sequential(torch.nn.Module):
    method __init__ (line 9) | def __init__(
    method forward (line 59) | def forward(self, g, x):
  class Sequential (line 72) | class Sequential(torch.nn.Module):
    method __init__ (line 93) | def __init__(
    method _forward (line 112) | def _forward(self, g, x):
    method forward (line 122) | def forward(self, g, x=None):

FILE: espaloma/nn/tests/test_baseline.py
  function baseline (line 5) | def baseline():
  function test_init (line 25) | def test_init(baseline):
  function test_parameter (line 29) | def test_parameter(baseline):

FILE: espaloma/nn/tests/test_janossy.py
  function test_small_net (line 4) | def test_small_net():

FILE: espaloma/nn/tests/test_simple_net.py
  function test_small_net (line 4) | def test_small_net():

FILE: espaloma/utils/geometry.py
  function _sample_unit_circle (line 4) | def _sample_unit_circle(n_samples: int = 1) -> np.ndarray:
  function _sample_four_particle_torsion_scan (line 18) | def _sample_four_particle_torsion_scan(n_samples: int = 1) -> np.ndarray:
  function _timemachine_signed_torsion_angle (line 52) | def _timemachine_signed_torsion_angle(ci, cj, ck, cl):

FILE: espaloma/utils/model_fetch.py
  function _get_model_url (line 9) | def _get_model_url(version: str) -> str:
  function get_model_path (line 37) | def get_model_path(
  function get_model (line 96) | def get_model(version: str = "latest") -> dict[str, Any]:

FILE: espaloma/utils/tests/test_model_fetch.py
  function test_get_model_path (line 6) | def test_get_model_path(tmp_path):
  function test_get_model (line 18) | def test_get_model(tmp_path):

FILE: scripts/perses-benchmark/tyk2/espaloma-0.2.2/benchmark_analysis.py
  function get_simdir_list (line 30) | def get_simdir_list(base_dir='.', is_reversed=False):
  function get_simulations_data (line 58) | def get_simulations_data(simulation_dirs):
  function to_arsenic_csv (line 72) | def to_arsenic_csv(experimental_data: dict, simulation_data: list, out_c...

FILE: scripts/perses-benchmark/tyk2/espaloma-0.2.2/run_benchmarks.py
  function concatenate_files (line 33) | def concatenate_files(input_files, output_file):
  function run_relative_perturbation (line 44) | def run_relative_perturbation(lig_a_idx, lig_b_idx, reverse=False, tidy=...

FILE: scripts/perses-benchmark/tyk2/openff-1.2.0/benchmark_analysis.py
  function get_simdir_list (line 30) | def get_simdir_list(base_dir='.', is_reversed=False):
  function get_simulations_data (line 58) | def get_simulations_data(simulation_dirs):
  function to_arsenic_csv (line 72) | def to_arsenic_csv(experimental_data: dict, simulation_data: list, out_c...

FILE: scripts/perses-benchmark/tyk2/openff-1.2.0/run_benchmarks.py
  function concatenate_files (line 33) | def concatenate_files(input_files, output_file):
  function run_relative_perturbation (line 44) | def run_relative_perturbation(lig_a_idx, lig_b_idx, reverse=False, tidy=...

FILE: versioneer.py
  class VersioneerConfig (line 333) | class VersioneerConfig:
  function get_root (line 345) | def get_root() -> str:
  function get_config_from_root (line 394) | def get_config_from_root(root: str) -> VersioneerConfig:
  class NotThisMethod (line 442) | class NotThisMethod(Exception):
  function register_vcs_handler (line 451) | def register_vcs_handler(vcs: str, method: str) -> Callable:  # decorator
  function run_command (line 460) | def run_command(
  function git_get_keywords (line 1195) | def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
  function git_versions_from_keywords (line 1223) | def git_versions_from_keywords(
  function git_pieces_from_vcs (line 1291) | def git_pieces_from_vcs(
  function do_vcs_install (line 1428) | def do_vcs_install(versionfile_source: str, ipy: Optional[str]) -> None:
  function versions_from_parentdir (line 1466) | def versions_from_parentdir(
  function versions_from_file (line 1512) | def versions_from_file(filename: str) -> Dict[str, Any]:
  function write_to_version_file (line 1529) | def write_to_version_file(filename: str, versions: Dict[str, Any]) -> None:
  function plus_or_dot (line 1539) | def plus_or_dot(pieces: Dict[str, Any]) -> str:
  function render_pep440 (line 1546) | def render_pep440(pieces: Dict[str, Any]) -> str:
  function render_pep440_branch (line 1571) | def render_pep440_branch(pieces: Dict[str, Any]) -> str:
  function pep440_split_post (line 1601) | def pep440_split_post(ver: str) -> Tuple[str, Optional[int]]:
  function render_pep440_pre (line 1611) | def render_pep440_pre(pieces: Dict[str, Any]) -> str:
  function render_pep440_post (line 1635) | def render_pep440_post(pieces: Dict[str, Any]) -> str:
  function render_pep440_post_branch (line 1662) | def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
  function render_pep440_old (line 1691) | def render_pep440_old(pieces: Dict[str, Any]) -> str:
  function render_git_describe (line 1713) | def render_git_describe(pieces: Dict[str, Any]) -> str:
  function render_git_describe_long (line 1733) | def render_git_describe_long(pieces: Dict[str, Any]) -> str:
  function render (line 1753) | def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
  class VersioneerBadRootError (line 1789) | class VersioneerBadRootError(Exception):
  function get_versions (line 1793) | def get_versions(verbose: bool = False) -> Dict[str, Any]:
  function get_version (line 1869) | def get_version() -> str:
  function get_cmdclass (line 1874) | def get_cmdclass(cmdclass: Optional[Dict[str, Any]] = None):
  function do_setup (line 2173) | def do_setup() -> int:
  function scan_setup_py (line 2230) | def scan_setup_py() -> int:
  function setup_command (line 2267) | def setup_command() -> NoReturn:
Condensed preview — 297 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (726K chars).
[
  {
    "path": ".codecov.yml",
    "chars": 258,
    "preview": "# Codecov configuration to make it a bit less noisy\ncoverage:\n  status:\n    patch: false\n    project:\n      default:\n   "
  },
  {
    "path": ".gitattributes",
    "chars": 95,
    "preview": "*.ipynb linguist-documentation\n*.html linguist-documentation\nespaloma/_version.py export-subst\n"
  },
  {
    "path": ".github/workflows/CI.yaml",
    "chars": 2343,
    "preview": "name: CI\n\non:\n  pull_request:\n    branches:\n      - main\n  push:\n    branches:\n      - main \n\n  schedule:\n    # Nightly "
  },
  {
    "path": ".github/workflows/clean_cache.yaml",
    "chars": 1047,
    "preview": "# from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cach"
  },
  {
    "path": ".github/workflows/docker.yaml",
    "chars": 6232,
    "preview": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n"
  },
  {
    "path": ".gitignore",
    "chars": 1880,
    "preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# data\n*.sdf\n*.csv\n\n# Di"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 310,
    "preview": "version: 2\n\nbuild:\n  os: \"ubuntu-20.04\"\n  tools:\n    python: \"mambaforge-4.10\"\n\nsphinx:\n   configuration: docs/conf.py\n "
  },
  {
    "path": "LICENSE",
    "chars": 1093,
    "preview": "\nMIT License\n\nCopyright (c) 2020 Yuanqing Wang @ choderalab // MSKCC\n\nPermission is hereby granted, free of charge, to a"
  },
  {
    "path": "MANIFEST.in",
    "chars": 115,
    "preview": "include LICENSE\ninclude MANIFEST.in\ninclude versioneer.py\n\ngraft espaloma\nglobal-exclude *.py[cod] __pycache__ *.so"
  },
  {
    "path": "README.md",
    "chars": 6284,
    "preview": "espaloma: **E**xtensible **S**urrogate **P**otenti**al** **O**ptimized by **M**essage-passing **A**lgorithms 🍹\n========="
  },
  {
    "path": "devtools/README.md",
    "chars": 3215,
    "preview": "# Development, testing, and deployment tools\n\nThis directory contains a collection of tools for running Continuous Integ"
  },
  {
    "path": "devtools/conda-envs/espaloma.yaml",
    "chars": 657,
    "preview": "name: espaloma-test\nchannels:\n  - conda-forge\n  - openeye\ndependencies:\n  # Base dependencies\n  - python\n  - pip\n  # 3rd"
  },
  {
    "path": "devtools/conda-recipe/build.sh",
    "chars": 14,
    "preview": "pip install .\n"
  },
  {
    "path": "devtools/conda-recipe/meta.yml",
    "chars": 636,
    "preview": "package:\n  name: espaloma\n  version: !!str 0.0.0\n\nsource:\n  path: ../../\n\nbuild:\n  preserve_egg_dir: True\n  number: 0\n\nr"
  },
  {
    "path": "devtools/gh-actions/initialize_conda.sh",
    "chars": 164,
    "preview": "case $CI_OS in\n    windows*)\n        eval \"$(${CONDA}/condabin/conda.bat shell.bash hook)\";;\n    *)\n        eval \"$(${CO"
  },
  {
    "path": "devtools/scripts/create_conda_env.py",
    "chars": 3861,
    "preview": "import argparse\nimport glob\nimport os\nimport re\nimport shutil\nimport subprocess as sp\nfrom contextlib import contextmana"
  },
  {
    "path": "docker/Dockerfile",
    "chars": 858,
    "preview": "FROM mambaorg/micromamba:1.4.9\n\nLABEL org.opencontainers.image.source=https://github.com/choderalab/espaloma\nLABEL org.o"
  },
  {
    "path": "docs/Makefile",
    "chars": 605,
    "preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHI"
  },
  {
    "path": "docs/README.md",
    "chars": 585,
    "preview": "# Compiling espaloma's Documentation\n\nThe docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/mas"
  },
  {
    "path": "docs/_static/README.md",
    "chars": 507,
    "preview": "# Static Doc Directory\n\nAdd any paths that contain custom static files (such as style sheets) here,\nrelative to the `con"
  },
  {
    "path": "docs/_templates/README.md",
    "chars": 470,
    "preview": "# Templates Doc Directory\n\nAdd any paths that contain templates here, relative to  \nthe `conf.py` file's directory.\nThey"
  },
  {
    "path": "docs/_templates/custom-class-template.rst",
    "chars": 611,
    "preview": "{{ fullname | escape | underline}}\n\n.. currentmodule:: {{ module }}\n\n.. autoclass:: {{ objname }}\n   :members:\n   :show-"
  },
  {
    "path": "docs/_templates/custom-module-template.rst",
    "chars": 1211,
    "preview": "{{ fullname | escape | underline}}\n\n.. automodule:: {{ fullname }}\n  \n   {% block attributes %}\n   {% if attributes %}\n "
  },
  {
    "path": "docs/api.rst",
    "chars": 203,
    "preview": "API Documentation\n=================\n\n.. autosummary::\n   :toctree: autosummary\n   :template: custom-module-template.rst\n"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.alkethoh.rst",
    "chars": 140,
    "preview": "espaloma.data.collection.alkethoh\n=================================\n\n.. currentmodule:: espaloma.data.collection\n\n.. aut"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.esol.rst",
    "chars": 128,
    "preview": "espaloma.data.collection.esol\n=============================\n\n.. currentmodule:: espaloma.data.collection\n\n.. autofunctio"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.md17_new.rst",
    "chars": 142,
    "preview": "espaloma.data.collection.md17\\_new\n==================================\n\n.. currentmodule:: espaloma.data.collection\n\n.. a"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.md17_old.rst",
    "chars": 142,
    "preview": "espaloma.data.collection.md17\\_old\n==================================\n\n.. currentmodule:: espaloma.data.collection\n\n.. a"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.qca.rst",
    "chars": 437,
    "preview": "espaloma.data.collection.qca\n============================\n\n.. currentmodule:: espaloma.data.collection\n\n.. autoclass:: q"
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.rst",
    "chars": 407,
    "preview": "espaloma.data.collection\n========================\n\n.. automodule:: espaloma.data.collection\n  \n   \n   \n   \n\n   \n   \n   ."
  },
  {
    "path": "docs/autosummary/espaloma.data.collection.zinc.rst",
    "chars": 128,
    "preview": "espaloma.data.collection.zinc\n=============================\n\n.. currentmodule:: espaloma.data.collection\n\n.. autofunctio"
  },
  {
    "path": "docs/autosummary/espaloma.data.dataset.Dataset.rst",
    "chars": 444,
    "preview": "espaloma.data.dataset.Dataset\n=============================\n\n.. currentmodule:: espaloma.data.dataset\n\n.. autoclass:: Da"
  },
  {
    "path": "docs/autosummary/espaloma.data.dataset.GraphDataset.rst",
    "chars": 545,
    "preview": "espaloma.data.dataset.GraphDataset\n==================================\n\n.. currentmodule:: espaloma.data.dataset\n\n.. auto"
  },
  {
    "path": "docs/autosummary/espaloma.data.dataset.rst",
    "chars": 284,
    "preview": "espaloma.data.dataset\n=====================\n\n.. automodule:: espaloma.data.dataset\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.data.md.MoleculeVacuumSimulation.rst",
    "chars": 457,
    "preview": "espaloma.data.md.MoleculeVacuumSimulation\n=========================================\n\n.. currentmodule:: espaloma.data.md"
  },
  {
    "path": "docs/autosummary/espaloma.data.md.rst",
    "chars": 409,
    "preview": "espaloma.data.md\n================\n\n.. automodule:: espaloma.data.md\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Functions\n\n  "
  },
  {
    "path": "docs/autosummary/espaloma.data.md.subtract_nonbonded_force.rst",
    "chars": 168,
    "preview": "espaloma.data.md.subtract\\_nonbonded\\_force\n===========================================\n\n.. currentmodule:: espaloma.dat"
  },
  {
    "path": "docs/autosummary/espaloma.data.md.subtract_nonbonded_force_except_14.rst",
    "chars": 202,
    "preview": "espaloma.data.md.subtract\\_nonbonded\\_force\\_except\\_14\n=======================================================\n\n.. curr"
  },
  {
    "path": "docs/autosummary/espaloma.data.md17_utils.get_molecule.rst",
    "chars": 156,
    "preview": "espaloma.data.md17\\_utils.get\\_molecule\n=======================================\n\n.. currentmodule:: espaloma.data.md17_u"
  },
  {
    "path": "docs/autosummary/espaloma.data.md17_utils.realize_molecule.rst",
    "chars": 168,
    "preview": "espaloma.data.md17\\_utils.realize\\_molecule\n===========================================\n\n.. currentmodule:: espaloma.dat"
  },
  {
    "path": "docs/autosummary/espaloma.data.md17_utils.rst",
    "chars": 281,
    "preview": "espaloma.data.md17\\_utils\n=========================\n\n.. automodule:: espaloma.data.md17_utils\n  \n   \n   \n   \n\n   \n   \n  "
  },
  {
    "path": "docs/autosummary/espaloma.data.md17_utils.sum_offsets.rst",
    "chars": 153,
    "preview": "espaloma.data.md17\\_utils.sum\\_offsets\n======================================\n\n.. currentmodule:: espaloma.data.md17_uti"
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.BaseNormalize.rst",
    "chars": 344,
    "preview": "espaloma.data.normalize.BaseNormalize\n=====================================\n\n.. currentmodule:: espaloma.data.normalize\n"
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.DatasetLogNormalNormalize.rst",
    "chars": 392,
    "preview": "espaloma.data.normalize.DatasetLogNormalNormalize\n=================================================\n\n.. currentmodule:: "
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.DatasetNormalNormalize.rst",
    "chars": 380,
    "preview": "espaloma.data.normalize.DatasetNormalNormalize\n==============================================\n\n.. currentmodule:: espalo"
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.ESOL100LogNormalNormalize.rst",
    "chars": 392,
    "preview": "espaloma.data.normalize.ESOL100LogNormalNormalize\n=================================================\n\n.. currentmodule:: "
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.ESOL100NormalNormalize.rst",
    "chars": 380,
    "preview": "espaloma.data.normalize.ESOL100NormalNormalize\n==============================================\n\n.. currentmodule:: espalo"
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.NotNormalize.rst",
    "chars": 340,
    "preview": "espaloma.data.normalize.NotNormalize\n====================================\n\n.. currentmodule:: espaloma.data.normalize\n\n."
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.PositiveNotNormalize.rst",
    "chars": 372,
    "preview": "espaloma.data.normalize.PositiveNotNormalize\n============================================\n\n.. currentmodule:: espaloma.d"
  },
  {
    "path": "docs/autosummary/espaloma.data.normalize.rst",
    "chars": 445,
    "preview": "espaloma.data.normalize\n=======================\n\n.. automodule:: espaloma.data.normalize\n  \n   \n   \n   \n\n   \n   \n   \n\n  "
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.MolWithTargets.rst",
    "chars": 597,
    "preview": "espaloma.data.qcarchive\\_utils.MolWithTargets\n=============================================\n\n.. currentmodule:: espaloma"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.breakdown_along_time_axis.rst",
    "chars": 214,
    "preview": "espaloma.data.qcarchive\\_utils.breakdown\\_along\\_time\\_axis\n===========================================================\n"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.fetch_td_record.rst",
    "chars": 182,
    "preview": "espaloma.data.qcarchive\\_utils.fetch\\_td\\_record\n================================================\n\n.. currentmodule:: es"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.get_client.rst",
    "chars": 165,
    "preview": "espaloma.data.qcarchive\\_utils.get\\_client\n==========================================\n\n.. currentmodule:: espaloma.data."
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.get_collection.rst",
    "chars": 177,
    "preview": "espaloma.data.qcarchive\\_utils.get\\_collection\n==============================================\n\n.. currentmodule:: espalo"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.get_energy_and_gradient.rst",
    "chars": 208,
    "preview": "espaloma.data.qcarchive\\_utils.get\\_energy\\_and\\_gradient\n=========================================================\n\n.. "
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.get_graph.rst",
    "chars": 162,
    "preview": "espaloma.data.qcarchive\\_utils.get\\_graph\n=========================================\n\n.. currentmodule:: espaloma.data.qc"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.h5_to_dataset.rst",
    "chars": 176,
    "preview": "espaloma.data.qcarchive\\_utils.h5\\_to\\_dataset\n==============================================\n\n.. currentmodule:: espalo"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.make_batch_size_consistent.rst",
    "chars": 217,
    "preview": "espaloma.data.qcarchive\\_utils.make\\_batch\\_size\\_consistent\n==========================================================="
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.rst",
    "chars": 585,
    "preview": "espaloma.data.qcarchive\\_utils\n==============================\n\n.. automodule:: espaloma.data.qcarchive_utils\n  \n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.data.qcarchive_utils.weight_by_snapshots.rst",
    "chars": 194,
    "preview": "espaloma.data.qcarchive\\_utils.weight\\_by\\_snapshots\n====================================================\n\n.. currentmod"
  },
  {
    "path": "docs/autosummary/espaloma.data.rst",
    "chars": 411,
    "preview": "espaloma.data\n=============\n\n.. automodule:: espaloma.data\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n\n\n.. "
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.batch.rst",
    "chars": 116,
    "preview": "espaloma.data.utils.batch\n=========================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofunction:: batch"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.collate_fn.rst",
    "chars": 133,
    "preview": "espaloma.data.utils.collate\\_fn\n===============================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofunction"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.from_csv.rst",
    "chars": 127,
    "preview": "espaloma.data.utils.from\\_csv\n=============================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofunction:: f"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.infer_mol_from_coordinates.rst",
    "chars": 185,
    "preview": "espaloma.data.utils.infer\\_mol\\_from\\_coordinates\n=================================================\n\n.. currentmodule:: "
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.make_temp_directory.rst",
    "chars": 162,
    "preview": "espaloma.data.utils.make\\_temp\\_directory\n=========================================\n\n.. currentmodule:: espaloma.data.ut"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.normalize.rst",
    "chars": 128,
    "preview": "espaloma.data.utils.normalize\n=============================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofunction:: n"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.rst",
    "chars": 353,
    "preview": "espaloma.data.utils\n===================\n\n.. automodule:: espaloma.data.utils\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Func"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.split.rst",
    "chars": 116,
    "preview": "espaloma.data.utils.split\n=========================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofunction:: split"
  },
  {
    "path": "docs/autosummary/espaloma.data.utils.sum_offsets.rst",
    "chars": 136,
    "preview": "espaloma.data.utils.sum\\_offsets\n================================\n\n.. currentmodule:: espaloma.data.utils\n\n.. autofuncti"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.deploy.load_forcefield.rst",
    "chars": 157,
    "preview": "espaloma.graphs.deploy.load\\_forcefield\n=======================================\n\n.. currentmodule:: espaloma.graphs.depl"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.deploy.openmm_system_from_graph.rst",
    "chars": 188,
    "preview": "espaloma.graphs.deploy.openmm\\_system\\_from\\_graph\n==================================================\n\n.. currentmodule:"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.deploy.rst",
    "chars": 266,
    "preview": "espaloma.graphs.deploy\n======================\n\n.. automodule:: espaloma.graphs.deploy\n  \n   \n   \n   \n\n   \n   \n   .. rubr"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.graph.BaseGraph.rst",
    "chars": 322,
    "preview": "espaloma.graphs.graph.BaseGraph\n===============================\n\n.. currentmodule:: espaloma.graphs.graph\n\n.. autoclass:"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.graph.Graph.rst",
    "chars": 538,
    "preview": "espaloma.graphs.graph.Graph\n===========================\n\n.. currentmodule:: espaloma.graphs.graph\n\n.. autoclass:: Graph\n"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.graph.rst",
    "chars": 279,
    "preview": "espaloma.graphs.graph\n=====================\n\n.. automodule:: espaloma.graphs.graph\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.legacy_force_field.LegacyForceField.rst",
    "chars": 537,
    "preview": "espaloma.graphs.legacy\\_force\\_field.LegacyForceField\n=====================================================\n\n.. currentm"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.legacy_force_field.rst",
    "chars": 317,
    "preview": "espaloma.graphs.legacy\\_force\\_field\n====================================\n\n.. automodule:: espaloma.graphs.legacy_force_"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.rst",
    "chars": 347,
    "preview": "espaloma.graphs\n===============\n\n.. automodule:: espaloma.graphs\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.angle_indices.rst",
    "chars": 195,
    "preview": "espaloma.graphs.utils.offmol\\_indices.angle\\_indices\n====================================================\n\n.. currentmod"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.atom_indices.rst",
    "chars": 192,
    "preview": "espaloma.graphs.utils.offmol\\_indices.atom\\_indices\n===================================================\n\n.. currentmodul"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.bond_indices.rst",
    "chars": 192,
    "preview": "espaloma.graphs.utils.offmol\\_indices.bond\\_indices\n===================================================\n\n.. currentmodul"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.improper_torsion_indices.rst",
    "chars": 230,
    "preview": "espaloma.graphs.utils.offmol\\_indices.improper\\_torsion\\_indices\n======================================================="
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.proper_torsion_indices.rst",
    "chars": 224,
    "preview": "espaloma.graphs.utils.offmol\\_indices.proper\\_torsion\\_indices\n========================================================="
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.offmol_indices.rst",
    "chars": 375,
    "preview": "espaloma.graphs.utils.offmol\\_indices\n=====================================\n\n.. automodule:: espaloma.graphs.utils.offmo"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.duplicate_index_ordering.rst",
    "chars": 262,
    "preview": "espaloma.graphs.utils.read\\_heterogeneous\\_graph.duplicate\\_index\\_ordering\n============================================"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.from_homogeneous_and_mol.rst",
    "chars": 264,
    "preview": "espaloma.graphs.utils.read\\_heterogeneous\\_graph.from\\_homogeneous\\_and\\_mol\n==========================================="
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.relationship_indices_from_offmol.rst",
    "chars": 288,
    "preview": "espaloma.graphs.utils.read\\_heterogeneous\\_graph.relationship\\_indices\\_from\\_offmol\n==================================="
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_heterogeneous_graph.rst",
    "chars": 390,
    "preview": "espaloma.graphs.utils.read\\_heterogeneous\\_graph\n================================================\n\n.. automodule:: espal"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.fp_oe.rst",
    "chars": 197,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph.fp\\_oe\n=====================================================\n\n.. currentm"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.fp_rdkit.rst",
    "chars": 206,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph.fp\\_rdkit\n========================================================\n\n.. cu"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_oemol.rst",
    "chars": 212,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph.from\\_oemol\n==========================================================\n\n."
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_openff_toolkit_mol.rst",
    "chars": 255,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph.from\\_openff\\_toolkit\\_mol\n=============================================="
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.from_rdkit_mol.rst",
    "chars": 226,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph.from\\_rdkit\\_mol\n========================================================"
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.read_homogeneous_graph.rst",
    "chars": 378,
    "preview": "espaloma.graphs.utils.read\\_homogeneous\\_graph\n==============================================\n\n.. automodule:: espaloma."
  },
  {
    "path": "docs/autosummary/espaloma.graphs.utils.rst",
    "chars": 388,
    "preview": "espaloma.graphs.utils\n=====================\n\n.. automodule:: espaloma.graphs.utils\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.angle_high.rst",
    "chars": 127,
    "preview": "espaloma.mm.angle.angle\\_high\n=============================\n\n.. currentmodule:: espaloma.mm.angle\n\n.. autofunction:: ang"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.bond_angle.rst",
    "chars": 127,
    "preview": "espaloma.mm.angle.bond\\_angle\n=============================\n\n.. currentmodule:: espaloma.mm.angle\n\n.. autofunction:: bon"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.bond_bond.rst",
    "chars": 124,
    "preview": "espaloma.mm.angle.bond\\_bond\n============================\n\n.. currentmodule:: espaloma.mm.angle\n\n.. autofunction:: bond_"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.harmonic_angle.rst",
    "chars": 139,
    "preview": "espaloma.mm.angle.harmonic\\_angle\n=================================\n\n.. currentmodule:: espaloma.mm.angle\n\n.. autofuncti"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.linear_mixture_angle.rst",
    "chars": 159,
    "preview": "espaloma.mm.angle.linear\\_mixture\\_angle\n========================================\n\n.. currentmodule:: espaloma.mm.angle\n"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.rst",
    "chars": 315,
    "preview": "espaloma.mm.angle\n=================\n\n.. automodule:: espaloma.mm.angle\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Functions\n"
  },
  {
    "path": "docs/autosummary/espaloma.mm.angle.urey_bradley.rst",
    "chars": 133,
    "preview": "espaloma.mm.angle.urey\\_bradley\n===============================\n\n.. currentmodule:: espaloma.mm.angle\n\n.. autofunction::"
  },
  {
    "path": "docs/autosummary/espaloma.mm.bond.bond_high.rst",
    "chars": 121,
    "preview": "espaloma.mm.bond.bond\\_high\n===========================\n\n.. currentmodule:: espaloma.mm.bond\n\n.. autofunction:: bond_hig"
  },
  {
    "path": "docs/autosummary/espaloma.mm.bond.gaussian_bond.rst",
    "chars": 133,
    "preview": "espaloma.mm.bond.gaussian\\_bond\n===============================\n\n.. currentmodule:: espaloma.mm.bond\n\n.. autofunction:: "
  },
  {
    "path": "docs/autosummary/espaloma.mm.bond.harmonic_bond.rst",
    "chars": 133,
    "preview": "espaloma.mm.bond.harmonic\\_bond\n===============================\n\n.. currentmodule:: espaloma.mm.bond\n\n.. autofunction:: "
  },
  {
    "path": "docs/autosummary/espaloma.mm.bond.linear_mixture_bond.rst",
    "chars": 153,
    "preview": "espaloma.mm.bond.linear\\_mixture\\_bond\n======================================\n\n.. currentmodule:: espaloma.mm.bond\n\n.. a"
  },
  {
    "path": "docs/autosummary/espaloma.mm.bond.rst",
    "chars": 277,
    "preview": "espaloma.mm.bond\n================\n\n.. automodule:: espaloma.mm.bond\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Functions\n\n  "
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.CarryII.rst",
    "chars": 1255,
    "preview": "espaloma.mm.energy.CarryII\n==========================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autoclass:: CarryII\n   "
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.EnergyInGraph.rst",
    "chars": 1483,
    "preview": "espaloma.mm.energy.EnergyInGraph\n================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autoclass::"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.EnergyInGraphII.rst",
    "chars": 1559,
    "preview": "espaloma.mm.energy.EnergyInGraphII\n==================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autocla"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_angle.rst",
    "chars": 133,
    "preview": "espaloma.mm.energy.apply\\_angle\n===============================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autofunction:"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_angle_ii.rst",
    "chars": 144,
    "preview": "espaloma.mm.energy.apply\\_angle\\_ii\n===================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autof"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_angle_linear_mixture.rst",
    "chars": 182,
    "preview": "espaloma.mm.energy.apply\\_angle\\_linear\\_mixture\n================================================\n\n.. currentmodule:: es"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_bond.rst",
    "chars": 130,
    "preview": "espaloma.mm.energy.apply\\_bond\n==============================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autofunction:: "
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_bond_gaussian.rst",
    "chars": 159,
    "preview": "espaloma.mm.energy.apply\\_bond\\_gaussian\n========================================\n\n.. currentmodule:: espaloma.mm.energy"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_bond_ii.rst",
    "chars": 141,
    "preview": "espaloma.mm.energy.apply\\_bond\\_ii\n==================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autofun"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_bond_linear_mixture.rst",
    "chars": 179,
    "preview": "espaloma.mm.energy.apply\\_bond\\_linear\\_mixture\n===============================================\n\n.. currentmodule:: espa"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_improper_torsion.rst",
    "chars": 168,
    "preview": "espaloma.mm.energy.apply\\_improper\\_torsion\n===========================================\n\n.. currentmodule:: espaloma.mm."
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_nonbonded.rst",
    "chars": 145,
    "preview": "espaloma.mm.energy.apply\\_nonbonded\n===================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autof"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_torsion.rst",
    "chars": 139,
    "preview": "espaloma.mm.energy.apply\\_torsion\n=================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. autofunct"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.apply_torsion_ii.rst",
    "chars": 150,
    "preview": "espaloma.mm.energy.apply\\_torsion\\_ii\n=====================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. a"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.energy_in_graph.rst",
    "chars": 147,
    "preview": "espaloma.mm.energy.energy\\_in\\_graph\n====================================\n\n.. currentmodule:: espaloma.mm.energy\n\n.. aut"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.energy_in_graph_ii.rst",
    "chars": 158,
    "preview": "espaloma.mm.energy.energy\\_in\\_graph\\_ii\n========================================\n\n.. currentmodule:: espaloma.mm.energy"
  },
  {
    "path": "docs/autosummary/espaloma.mm.energy.rst",
    "chars": 676,
    "preview": "espaloma.mm.energy\n==================\n\n.. automodule:: espaloma.mm.energy\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Functio"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.gaussian.rst",
    "chars": 134,
    "preview": "espaloma.mm.functional.gaussian\n===============================\n\n.. currentmodule:: espaloma.mm.functional\n\n.. autofunct"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.harmonic.rst",
    "chars": 134,
    "preview": "espaloma.mm.functional.harmonic\n===============================\n\n.. currentmodule:: espaloma.mm.functional\n\n.. autofunct"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.harmonic_harmonic_coupled.rst",
    "chars": 189,
    "preview": "espaloma.mm.functional.harmonic\\_harmonic\\_coupled\n==================================================\n\n.. currentmodule:"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.harmonic_harmonic_periodic_coupled.rst",
    "chars": 218,
    "preview": "espaloma.mm.functional.harmonic\\_harmonic\\_periodic\\_coupled\n==========================================================="
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.harmonic_periodic_coupled.rst",
    "chars": 189,
    "preview": "espaloma.mm.functional.harmonic\\_periodic\\_coupled\n==================================================\n\n.. currentmodule:"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.linear_mixture.rst",
    "chars": 154,
    "preview": "espaloma.mm.functional.linear\\_mixture\n======================================\n\n.. currentmodule:: espaloma.mm.functional"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.linear_mixture_to_original.rst",
    "chars": 194,
    "preview": "espaloma.mm.functional.linear\\_mixture\\_to\\_original\n====================================================\n\n.. currentmod"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.lj.rst",
    "chars": 116,
    "preview": "espaloma.mm.functional.lj\n=========================\n\n.. currentmodule:: espaloma.mm.functional\n\n.. autofunction:: lj"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.periodic.rst",
    "chars": 134,
    "preview": "espaloma.mm.functional.periodic\n===============================\n\n.. currentmodule:: espaloma.mm.functional\n\n.. autofunct"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.periodic_fixed_phases.rst",
    "chars": 177,
    "preview": "espaloma.mm.functional.periodic\\_fixed\\_phases\n==============================================\n\n.. currentmodule:: espalo"
  },
  {
    "path": "docs/autosummary/espaloma.mm.functional.rst",
    "chars": 454,
    "preview": "espaloma.mm.functional\n======================\n\n.. automodule:: espaloma.mm.functional\n  \n   \n   \n   \n\n   \n   \n   .. rubr"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.GeometryInGraph.rst",
    "chars": 1565,
    "preview": "espaloma.mm.geometry.GeometryInGraph\n====================================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. a"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.angle.rst",
    "chars": 119,
    "preview": "espaloma.mm.geometry.angle\n==========================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofunction:: angle"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.apply_angle.rst",
    "chars": 139,
    "preview": "espaloma.mm.geometry.apply\\_angle\n=================================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofun"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.apply_bond.rst",
    "chars": 136,
    "preview": "espaloma.mm.geometry.apply\\_bond\n================================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofunct"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.apply_torsion.rst",
    "chars": 145,
    "preview": "espaloma.mm.geometry.apply\\_torsion\n===================================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. aut"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.copy_src.rst",
    "chars": 130,
    "preview": "espaloma.mm.geometry.copy\\_src\n==============================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofunction:"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.dihedral.rst",
    "chars": 128,
    "preview": "espaloma.mm.geometry.dihedral\n=============================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofunction:: "
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.distance.rst",
    "chars": 128,
    "preview": "espaloma.mm.geometry.distance\n=============================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autofunction:: "
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.geometry_in_graph.rst",
    "chars": 159,
    "preview": "espaloma.mm.geometry.geometry\\_in\\_graph\n========================================\n\n.. currentmodule:: espaloma.mm.geomet"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.reduce_stack.rst",
    "chars": 142,
    "preview": "espaloma.mm.geometry.reduce\\_stack\n==================================\n\n.. currentmodule:: espaloma.mm.geometry\n\n.. autof"
  },
  {
    "path": "docs/autosummary/espaloma.mm.geometry.rst",
    "chars": 495,
    "preview": "espaloma.mm.geometry\n====================\n\n.. automodule:: espaloma.mm.geometry\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: F"
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.arithmetic_mean.rst",
    "chars": 154,
    "preview": "espaloma.mm.nonbonded.arithmetic\\_mean\n======================================\n\n.. currentmodule:: espaloma.mm.nonbonded\n"
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.geometric_mean.rst",
    "chars": 151,
    "preview": "espaloma.mm.nonbonded.geometric\\_mean\n=====================================\n\n.. currentmodule:: espaloma.mm.nonbonded\n\n."
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.lj_12_6.rst",
    "chars": 132,
    "preview": "espaloma.mm.nonbonded.lj\\_12\\_6\n===============================\n\n.. currentmodule:: espaloma.mm.nonbonded\n\n.. autofuncti"
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.lj_9_6.rst",
    "chars": 129,
    "preview": "espaloma.mm.nonbonded.lj\\_9\\_6\n==============================\n\n.. currentmodule:: espaloma.mm.nonbonded\n\n.. autofunction"
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.lorentz_berthelot.rst",
    "chars": 160,
    "preview": "espaloma.mm.nonbonded.lorentz\\_berthelot\n========================================\n\n.. currentmodule:: espaloma.mm.nonbon"
  },
  {
    "path": "docs/autosummary/espaloma.mm.nonbonded.rst",
    "chars": 304,
    "preview": "espaloma.mm.nonbonded\n=====================\n\n.. automodule:: espaloma.mm.nonbonded\n  \n   \n   \n   \n\n   \n   \n   .. rubric:"
  },
  {
    "path": "docs/autosummary/espaloma.mm.rst",
    "chars": 382,
    "preview": "espaloma.mm\n===========\n\n.. automodule:: espaloma.mm\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n\n\n.. rubric"
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.angle_angle.rst",
    "chars": 136,
    "preview": "espaloma.mm.torsion.angle\\_angle\n================================\n\n.. currentmodule:: espaloma.mm.torsion\n\n.. autofuncti"
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.angle_angle_torsion.rst",
    "chars": 162,
    "preview": "espaloma.mm.torsion.angle\\_angle\\_torsion\n=========================================\n\n.. currentmodule:: espaloma.mm.tors"
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.angle_torsion.rst",
    "chars": 142,
    "preview": "espaloma.mm.torsion.angle\\_torsion\n==================================\n\n.. currentmodule:: espaloma.mm.torsion\n\n.. autofu"
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.bond_torsion.rst",
    "chars": 139,
    "preview": "espaloma.mm.torsion.bond\\_torsion\n=================================\n\n.. currentmodule:: espaloma.mm.torsion\n\n.. autofunc"
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.periodic_torsion.rst",
    "chars": 151,
    "preview": "espaloma.mm.torsion.periodic\\_torsion\n=====================================\n\n.. currentmodule:: espaloma.mm.torsion\n\n.. "
  },
  {
    "path": "docs/autosummary/espaloma.mm.torsion.rst",
    "chars": 310,
    "preview": "espaloma.mm.torsion\n===================\n\n.. automodule:: espaloma.mm.torsion\n  \n   \n   \n   \n\n   \n   \n   .. rubric:: Func"
  },
  {
    "path": "docs/autosummary/espaloma.nn.baselines.FreeParameterBaseline.rst",
    "chars": 1796,
    "preview": "espaloma.nn.baselines.FreeParameterBaseline\n===========================================\n\n.. currentmodule:: espaloma.nn."
  },
  {
    "path": "docs/autosummary/espaloma.nn.baselines.FreeParameterBaselineInitMean.rst",
    "chars": 2100,
    "preview": "espaloma.nn.baselines.FreeParameterBaselineInitMean\n===================================================\n\n.. currentmodul"
  },
  {
    "path": "docs/autosummary/espaloma.nn.baselines.rst",
    "chars": 315,
    "preview": "espaloma.nn.baselines\n=====================\n\n.. automodule:: espaloma.nn.baselines\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.nn.layers.dgl_legacy.GN.rst",
    "chars": 140,
    "preview": "espaloma.nn.layers.dgl\\_legacy.gn\n=================================\n\n.. currentmodule:: espaloma.nn.layers.dgl_legacy\n\n"
  },
  {
    "path": "docs/autosummary/espaloma.nn.layers.dgl_legacy.rst",
    "chars": 365,
    "preview": "espaloma.nn.layers.dgl\\_legacy\n==============================\n\n.. automodule:: espaloma.nn.layers.dgl_legacy\n  \n   \n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.nn.layers.rst",
    "chars": 274,
    "preview": "espaloma.nn.layers\n==================\n\n.. automodule:: espaloma.nn.layers\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n   \n"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.base_readout.BaseReadout.rst",
    "chars": 1451,
    "preview": "espaloma.nn.readout.base\\_readout.BaseReadout\n=============================================\n\n.. currentmodule:: espaloma"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.base_readout.rst",
    "chars": 304,
    "preview": "espaloma.nn.readout.base\\_readout\n=================================\n\n.. automodule:: espaloma.nn.readout.base_readout\n  "
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.charge_equilibrium.ChargeEquilibrium.rst",
    "chars": 1697,
    "preview": "espaloma.nn.readout.charge\\_equilibrium.ChargeEquilibrium\n=========================================================\n\n.. "
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.charge_equilibrium.get_charges.rst",
    "chars": 195,
    "preview": "espaloma.nn.readout.charge\\_equilibrium.get\\_charges\n====================================================\n\n.. currentmod"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.charge_equilibrium.rst",
    "chars": 416,
    "preview": "espaloma.nn.readout.charge\\_equilibrium\n=======================================\n\n.. automodule:: espaloma.nn.readout.cha"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.graph_level_readout.GraphLevelReadout.rst",
    "chars": 1702,
    "preview": "espaloma.nn.readout.graph\\_level\\_readout.GraphLevelReadout\n===========================================================\n"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.graph_level_readout.rst",
    "chars": 333,
    "preview": "espaloma.nn.readout.graph\\_level\\_readout\n=========================================\n\n.. automodule:: espaloma.nn.readout"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.ExpCoefficients.rst",
    "chars": 1586,
    "preview": "espaloma.nn.readout.janossy.ExpCoefficients\n===========================================\n\n.. currentmodule:: espaloma.nn."
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.JanossyPooling.rst",
    "chars": 1548,
    "preview": "espaloma.nn.readout.janossy.JanossyPooling\n==========================================\n\n.. currentmodule:: espaloma.nn.re"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.JanossyPoolingImproper.rst",
    "chars": 1852,
    "preview": "espaloma.nn.readout.janossy.JanossyPoolingImproper\n==================================================\n\n.. currentmodule:"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.JanossyPoolingNonbonded.rst",
    "chars": 1890,
    "preview": "espaloma.nn.readout.janossy.JanossyPoolingNonbonded\n===================================================\n\n.. currentmodul"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.LinearMixtureToOriginal.rst",
    "chars": 1890,
    "preview": "espaloma.nn.readout.janossy.LinearMixtureToOriginal\n===================================================\n\n.. currentmodul"
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.janossy.rst",
    "chars": 401,
    "preview": "espaloma.nn.readout.janossy\n===========================\n\n.. automodule:: espaloma.nn.readout.janossy\n  \n   \n   \n   \n\n   "
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.node_typing.NodeTyping.rst",
    "chars": 1410,
    "preview": "espaloma.nn.readout.node\\_typing.NodeTyping\n===========================================\n\n.. currentmodule:: espaloma.nn."
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.node_typing.rst",
    "chars": 300,
    "preview": "espaloma.nn.readout.node\\_typing\n================================\n\n.. automodule:: espaloma.nn.readout.node_typing\n  \n  "
  },
  {
    "path": "docs/autosummary/espaloma.nn.readout.rst",
    "chars": 431,
    "preview": "espaloma.nn.readout\n===================\n\n.. automodule:: espaloma.nn.readout\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n "
  },
  {
    "path": "docs/autosummary/espaloma.nn.rst",
    "chars": 317,
    "preview": "espaloma.nn\n===========\n\n.. automodule:: espaloma.nn\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n   \n   \n   \n\n\n\n.. rubric"
  },
  {
    "path": "docs/autosummary/espaloma.nn.sequential.Sequential.rst",
    "chars": 1381,
    "preview": "espaloma.nn.sequential.Sequential\n=================================\n\n.. currentmodule:: espaloma.nn.sequential\n\n.. autoc"
  },
  {
    "path": "docs/autosummary/espaloma.nn.sequential.rst",
    "chars": 271,
    "preview": "espaloma.nn.sequential\n======================\n\n.. automodule:: espaloma.nn.sequential\n  \n   \n   \n   \n\n   \n   \n   \n\n   \n "
  },
  {
    "path": "docs/conf.py",
    "chars": 5360,
    "preview": "# -*- coding: utf-8 -*-\n#\n# Configuration file for the Sphinx documentation builder.\n#\n# This file does only contain a s"
  },
  {
    "path": "docs/deploy.rst",
    "chars": 1337,
    "preview": "Deploy espaloma 0.3.2 force field to parametrize your MM system\n========================================================"
  },
  {
    "path": "docs/download_experiments.sh",
    "chars": 941,
    "preview": "export fileid=1qdHEypk3uMhZEYCStWTU8u1uIDHzH3Qy\nwget -O typing.ipynb 'https://docs.google.com/uc?export=download&id='$fi"
  },
  {
    "path": "docs/experiments/index.rst",
    "chars": 166,
    "preview": "To reproduce experiments in paper https://arxiv.org/abs/2010.01196\n\n\n.. toctree::\n   :maxdepth: 2\n   :caption: Contents:"
  },
  {
    "path": "docs/experiments/mm_fitting_small.rst",
    "chars": 8807,
    "preview": "Toy experiment: Molecular mechanics (MM) fitting on subsampled PhAlkEthOH dataset.\n====================================="
  },
  {
    "path": "docs/experiments/qm_fitting.rst",
    "chars": 9542,
    "preview": "Quantum mechanics (QM) fitting experiment.\n==========================================\n\n**Open in Google Colab:**\nhttp://"
  },
  {
    "path": "docs/experiments/typing.rst",
    "chars": 4782,
    "preview": "Atom typing recovery experiment.\n================================\n\n**Open in Google Colab**:\nhttp://data.wangyq.net/esp_"
  },
  {
    "path": "docs/index.rst",
    "chars": 2504,
    "preview": ".. espaloma documentation master file, created by\n   sphinx-quickstart on Thu Mar 15 13:55:56 2018.\n   You can adapt thi"
  },
  {
    "path": "docs/install.rst",
    "chars": 305,
    "preview": "Installation\n============\n\nmamba\n-----\n\nWe recommend using `mamba <https://mamba.readthedocs.io/en/latest/mamba-installa"
  },
  {
    "path": "docs/make.bat",
    "chars": 772,
    "preview": "@ECHO OFF\n\npushd %~dp0\n\nREM Command file for Sphinx documentation\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-bu"
  },
  {
    "path": "docs/qm_fitting.rst",
    "chars": 9542,
    "preview": "Quantum mechanics (QM) fitting experiment.\n==========================================\n\n**Open in Google Colab:**\nhttp://"
  },
  {
    "path": "espaloma/.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "espaloma/__init__.py",
    "chars": 1035,
    "preview": "\"\"\"\nespaloma\nExtensible Surrogate Potential of Ab initio Learned and Optimized by Message-passing Algorithm\n\"\"\"\n\nfrom . "
  },
  {
    "path": "espaloma/_version.py",
    "chars": 24498,
    "preview": "\n# This file helps to compute a version number in source trees obtained from\n# git-archive tarball (such as those provid"
  }
]

// ... and 97 more files (download for full content)

About this extraction

This page contains the full source code of the choderalab/espaloma GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 297 files (652.0 KB), approximately 179.3k tokens, and a symbol index with 455 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!