Skip to main content

An example minimal project that compiles bindings using nanobind and scikit-build

Project description

Wick&d

Wick&d is a Python library for the algebra of second quantization for fermionic systems. It implements Wick's contraction theorem for general Fermi vacua, making it well-suited for deriving equations in quantum chemistry methods such as coupled cluster, MBPT, and multireference theories.

Pip Wheels codecov DOI

Quick start

# Define a Slater determinant reference with occupied (o) and virtual (v) spaces
w.reset_space()
w.add_space("o", "fermion", "occupied", ["i", "j", "k", "l"])
w.add_space("v", "fermion", "unoccupied", ["a", "b", "c", "d"])

# Build the operators F
F = w.utils.gen_op("f", 1, "ov", "ov")
# Build the one-body operator T1 (occupied to virtual)
T1 = w.op("t", ["v+ o"])

# Build the product of F and T1
F_T1 = F @ T1

# Apply Wick's theorem and collect all fully contracted terms
wt = w.WickTheorem()
expr = wt.contract(F_T1, minrank=0, maxrank=4)

print(f"F T_{{1}} = {expr.latex()}")

Installation

From PyPI:

pip install wickd

Development version:

git clone https://github.com/fevangelista/wickd.git
cd wickd
pip install nanobind scikit-build-core[pyproject]
pip install --no-build-isolation -ve .

Requirements

  • Python ≥ 3.9
  • macOS or Linux
  • Boost (optional) — enables 1024-bit integer arithmetic for large prefactors; the library builds and runs without it

Testing

pip install pytest
pytest

Learning resources

  • Jupyter tutorials — step-by-step introduction to the library
  • Examples — worked derivations (e.g. coupled cluster equations)

Citation

If you use Wick&d in your research, please cite:

@article{Evangelista2022,
  author  = {Evangelista, Francesco A.},
  title   = {Automatic derivation of many-body theories based on general {Fermi} vacua},
  journal = {J. Chem. Phys.},
  volume  = {157},
  pages   = {064111},
  year    = {2022},
  doi     = {10.1063/5.0097858},
  url     = {https://doi.org/10.1063/5.0097858},
}

Contributing

Bug reports and pull requests are welcome via GitHub Issues.

License

Wick&d is released under the MIT License.

Project details


Download files

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

Source Distribution

wickd-1.2.2.tar.gz (38.6 MB view details)

Uploaded Source

File details

Details for the file wickd-1.2.2.tar.gz.

File metadata

  • Download URL: wickd-1.2.2.tar.gz
  • Upload date:
  • Size: 38.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wickd-1.2.2.tar.gz
Algorithm Hash digest
SHA256 6207750f44a8986b9222aec122f77ef386179644fc9c3621c0153e8c312ad1b3
MD5 2565175f408d38231c5e019298c58fec
BLAKE2b-256 a80003405b080b3f05612f410d87f74caa8307b88fe2036bbad67b009e09938d

See more details on using hashes here.

Provenance

The following attestation bundles were made for wickd-1.2.2.tar.gz:

Publisher: wheels.yml on fevangelista/wickd

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page