A composable F# framework for the complete quantum simulation pipeline: operator algebra → encoding → tapering → Trotterization → circuit export.
Encode, taper, Trotterize, and export quantum circuits from molecular integrals — with five fermionic encodings, three bosonic encodings, symbolic qubit tapering, and output to OpenQASM, Q#, and JSON. Zero dependencies.
Install
dotnet add package FockMap
Brand Assets
30-Second Example
open Encodings
// Encode the creation operator a†₂ on 4 modes using Jordan-Wigner
let pauli = jordanWignerTerms Raise 2u 4u
// → ½(ZZXI) − ½i(ZZYI)
// Same operator under Bravyi-Kitaev (O(log n) weight)
let pauliBK = bravyiKitaevTerms Raise 2u 4u
Why This Library?
| Feature | OpenFermion | Qiskit Nature | FockMap |
|---|---|---|---|
| Define a new encoding | ~200 lines | Not supported | 3–5 lines |
| Tree → encoding pipeline | ❌ | ❌ | ✅ |
| Type-safe operator algebra | ❌ | ❌ | ✅ |
| Pure functional, zero mutation | ❌ | ❌ | ✅ |
| Symbolic CAR + CCR normal ordering | ❌ | Partial | ✅ |
Available Encodings
| Encoding | Worst-Case Weight | Function |
|---|---|---|
| Jordan-Wigner | $O(n)$ | jordanWignerTerms |
| Bravyi-Kitaev | $O(\log_2 n)$ | bravyiKitaevTerms |
| Parity | $O(n)$ | parityTerms |
| Balanced Binary Tree | $O(\log_2 n)$ | balancedBinaryTreeTerms |
| Balanced Ternary Tree | $O(\log_3 n)$ | ternaryTreeTerms |
| Vlasov (Complete Ternary) | $O(\log_3 n)$ | vlasovTreeTerms |
Cross-Platform
Runs on Windows, macOS, and Linux via .NET 10 (LTS). Written in F#, fully open-source under the F# Software Foundation and the .NET Foundation.
Learn More
- The Book: From Molecules to Quantum Circuits — 22-chapter guide from molecular integrals to quantum circuits, with interactive labs and computed results (H₂ dissociation curve, H₂O bond angle scan)
- API Cookbook: Library Cookbook — every type and function, step by step
- Library Internals: Architecture Guide — two-framework design
- Cross-Platform: Running on Windows, macOS, Linux
- API Reference: All types and functions
Documentation
API Cookbook
A step-by-step guide to every FockMap type and function.
- Overview
- Building Expressions — the
C,P,Stype hierarchy - Indexed Operators —
IxOpand operator sequences - Creation & Annihilation — ladder operators
- Normal Ordering — CAR and CCR algebras
- Encodings — JW, BK, Parity, trees
- Building Hamiltonians — from integrals to Pauli sums
- Mixed Systems — fermion-boson hybrids
- Bosonic Encodings — unary, binary, Gray code
- Qubit Tapering — Z₂ symmetry reduction
Guides
- Architecture — two-framework design (index-set + path-based)
- Cross-Platform — .NET 10 and F# on all platforms