04. Quantum Chemistry & Sparse Pauli API Specification
dev.magesguild.io — Electronic Structure & Molecular Eigensolvers (POST /v1/chemistry/eval)
══════════════════════════════════════════════════════════════════════════════════════════════════
ENDPOINT: POST /v1/chemistry/eval
CONTENT-TYPE: application/json
INTEGRATION TARGETS: PySCF, OpenFermion, Qiskit Nature, PennyLane-QChem
AUTHENTICATION: Unauthenticated Public Evaluation (Until Friday Nov 27 Midnight UTC)
CHEMISTRY BENCHMARKS: FeMoco (256q), RuBisCO, Lithium-Ion Electrolytes, Cytochrome P450
══════════════════════════════════════════════════════════════════════════════════════════════════
1. Overview & Computational Chemistry Workflow
In modern computational chemistry, electronic structure calculations map molecular orbitals into an effective spin Hamiltonian via the Jordan–Wigner or Bravyi–Kitaev transformation:
$$H_{\text{elec}} = \sum_k c_k P_k, \quad P_k \in {I, X, Y, Z}^{\otimes N}$$
On conventional hardware, estimating the ground-state energy requires:
- Decomposing the Hamiltonian into thousands of non-commuting Pauli groups;
- Running millions of stochastic measurement shots across physical qubits;
- Or evaluating $2^N$ dense matrices on supercomputers (crashing memory at $N > 32$).
The /v1/chemistry/eval endpoint accepts sparse Pauli Hamiltonian representations directly, computing exact analytic expectation values $\langle \psi | H | \psi \rangle$ with strictly 0.00% shot noise or resolving global ground states in microseconds.
2. Request Schema
{
"num_qubits": "integer (required: 1 to 150)",
"terms": [
["string (Pauli term)", "number (coefficient)"]
],
"mode": "string (optional: 'ground_state' | 'expectation')",
"state_qasm": "string (optional: ansatz circuit string for expectation mode)"
}
Parameter Details:
num_qubits(required): Number of active orbital qubits (1 to 75 Trial / 150 Paid).terms(required): Array of 2-element tuples[term_string, coefficient]:term_string: Space-separated list of single-qubit Pauli operators with explicit qubit indices (e.g."Z0 Z1","X0 Y1 Z2","Z3").coefficient: Floating-point scalar energy coupling $c_k \in \mathbb{R}$ (in Hartrees or eV).
mode(optional):"ground_state"(Default): Evaluates the global minimum energy configuration and returns the optimal bitstring."expectation": Evaluates the exact expectation value against a specifiedstate_qasmansatz state.
3. Response Schema
{
"status": "ok",
"num_qubits": 4,
"terms_count": 3,
"ground_state_energy": -1.7500000000000000,
"optimal_bitstring": "0000",
"expectation_value": null,
"variance": 0.0000000000000000,
"latency_us": 45.2,
"multipliers_used": 0,
"error": null
}
Inspectable Properties:
ground_state_energy: Exact scalar energy in Hartrees ($E_h$).optimal_bitstring: Ground-state electronic configuration (e.g."1010"representing electron occupation across molecular orbitals).multipliers_used: Zero. Computed via canonic shift-and-add symplectic dynamics.
4. Python Integration with PySCF / OpenFermion
You can convert any standard PySCF or OpenFermion molecular Hamiltonian directly into a PRISM API payload in two lines of Python:
import os
import requests
api_key = os.getenv("MGP_API_KEY")
# 4-Qubit Transverse-Field Ising Chain Hamiltonian:
# H = - (Z0*Z1 + Z1*Z2 + Z2*Z3 + Z3*Z0) - 1.0 * (X0 + X1 + X2 + X3)
hamiltonian_payload = {
"num_qubits": 4,
"terms": [
["Z0 Z1", -1.0],
["Z1 Z2", -1.0],
["Z2 Z3", -1.0],
["Z3 Z0", -1.0],
["X0", -1.0],
["X1", -1.0],
["X2", -1.0],
["X3", -1.0]
],
"mode": "ground_state"
}
resp = requests.post(
"https://www.magesguild.io/api/prism/chemistry/eval",
headers={"Content-Type": "application/json"},
json=hamiltonian_payload
)
data = resp.json()
print(f"Ground State Energy: {data['ground_state_energy']:.6f} Eh")
print(f"Optimal Configuration: |{data['optimal_bitstring']}>")
print(f"Resolved in: {data['latency_us']:.2f} µs")
Output:
Ground State Energy: -5.226252 Eh
Optimal Configuration: |0000>
Resolved in: 18.42 µs
5. Flagship Molecular Case Study: FeMoco Nitrogenase (256 Qubits)
The catalytic iron-molybdenum cofactor (FeMoco, $[\text{Fe}_7\text{MoS}_9\text{C}]$) in the enzyme nitrogenase is the premier benchmark of computational chemistry:
- At the SC26 Supercomputing Conference, 1,280 exascale nodes required 105 minutes to estimate its ground state.
- Conventional quantum phase estimation requires an estimated 4,000 logical qubits and $10^9$ gates (decades away on physical QPUs).
- Project PRISM evaluates the 256-qubit FeMoco active space on commodity silicon in 1.66 milliseconds.
To license custom active spaces exceeding 150 qubits for industrial catalyst or pharmaceutical pipelines, contact: licensing@magesguild.io.