aqora / N2-CS-VQE
page_size to embed more in the static export.SELECT * FROM datan2_cs_vqe_complete.parquet) contains 160 rows (geometries) and 46 columns (features) in a unified structure. Each row represents a molecular geometry along the N₂ dissociation curve from 0.8 to 2.0 Å.
The dataset combines:
True, 150 have False)bond_length_angstrom: N-N bond length in Ångströms (ranging from 0.8 to 2.0 Å, 160 evenly-spaced points)energy_hf: Hartree-Fock energyenergy_mp2: MP2 (Møller-Plesset 2nd order) energyenergy_cisd: Configuration Interaction Singles Doubles energyenergy_ccsd: Coupled Cluster Singles Doubles energyenergy_ccsd_t: CCSD with perturbative triples energyenergy_fci: Full Configuration Interaction energy (exact within basis set)energy_casci_4_2, energy_casci_5_4, energy_casci_6_6, energy_casci_7_8: CASCI energiesenergy_casscf_4_2, energy_casscf_5_4, energy_casscf_6_6, energy_casscf_7_8: CASSCF energies(n_orbitals, n_electrons) e.g., (4,2) = 4 orbitals, 2 electronsenergy_cs_dd_5q: Contextual Subspace with double-d approximation (5 qubits) - noiseless simulation (all 160 geometries)energy_nc: Non-contextual energy - noiseless simulation (all 160 geometries)energy_cs_vqe_mean: Experimental CS-VQE energy from real quantum hardware (mean) - available for 10 geometries onlyenergy_cs_vqe_std: Standard deviation of CS-VQE experimental results - available for 10 geometries only
The 10 experimental geometries are at bond lengths: 0.80, 0.94, 1.06, 1.20, 1.34, 1.46, 1.60, 1.74, 1.86, and 2.00 Å (approximately evenly spaced across the dissociation curve).entropy_mp2, entropy_cisd, entropy_ccsd, entropy_fcientropy_casci_4_2, entropy_casci_5_4, entropy_casci_6_6, entropy_casci_7_8entropy_casscf_4_2, entropy_casscf_5_4, entropy_casscf_6_6, entropy_casscf_7_8entropy_cs_dd_5q: Entropy for CS-DD methodmo_energy_0 through mo_energy_9: Molecular orbital energies for the first 10 orbitalst1_diagnostic: T1 diagnostic (indicates multi-reference character)d1_diagnostic: D1 diagnostic (another multi-reference indicator)energy_cs_vqe_mean and energy_cs_vqe_std: Available for 10 geometries only (93.8% null)import polars as pl
from aqora_cli.pyarrow import dataset
import matplotlib.pyplot as plt
# Load the unified dataset from Aqora
df = pl.scan_pyarrow_dataset(dataset("aqora/n2-cs-vqe", "v1.1.1")).collect()
print(f"Dataset shape: {df.shape}")
print(f"Geometries with experimental data: {df['has_experimental_data'].sum()}")
# Example 1: Plot the complete dissociation curve
plt.figure(figsize=(12, 6))
# Plot classical methods (all 160 points)
plt.plot(df['bond_length_angstrom'], df['energy_fci'],
label='FCI (Exact)', linewidth=2, color='black', zorder=3)
plt.plot(df['bond_length_angstrom'], df['energy_ccsd_t'],
label='CCSD(T)', linestyle='--', alpha=0.7)
plt.plot(df['bond_length_angstrom'], df['energy_cs_dd_5q'],
label='CS-DD (5q, noiseless)', linestyle='-.', color='blue')
# Add experimental quantum results (10 points only)
df_exp = df.filter(pl.col('has_experimental_data'))
plt.errorbar(df_exp['bond_length_angstrom'].to_numpy(),
df_exp['energy_cs_vqe_mean'].to_numpy(),
yerr=df_exp['energy_cs_vqe_std'].to_numpy(),
fmt='o', label='CS-VQE (Quantum Hardware)',
capsize=5, markersize=8, color='red', zorder=4)
plt.xlabel('Bond Length (Å)', fontsize=12)
plt.ylabel('Energy (Hartree)', fontsize=12)
plt.title('N₂ Dissociation Curve: Classical vs Quantum Computing', fontsize=14)
plt.legend(fontsize=10)
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
# Example 2: Error analysis for experimental geometries
fig, ax = plt.subplots(figsize=(10, 6))
# Calculate errors relative to FCI (convert to eV)
df_exp = df_exp.with_columns([
((pl.col('energy_cs_dd_5q') - pl.col('energy_fci')) * 27.2114).alias('error_cs_dd'),
((pl.col('energy_cs_vqe_mean') - pl.col('energy_fci')) * 27.2114).alias('error_cs_vqe')
])
ax.plot(df_exp['bond_length_angstrom'].to_numpy(),
df_exp['error_cs_dd'].abs().to_numpy(),
'o-', label='CS-DD (noiseless)', markersize=8)
ax.errorbar(df_exp['bond_length_angstrom'].to_numpy(),
df_exp['error_cs_vqe'].abs().to_numpy(),
yerr=df_exp['energy_cs_vqe_std'].to_numpy() * 27.2114,
fmt='o-', label='CS-VQE (hardware)', capsize=4, markersize=8)
ax.axhline(y=0.0016 * 27.2114, color='gray', linestyle='--',
label='Chemical accuracy (1 kcal/mol)', alpha=0.7)
ax.set_xlabel('Bond Length (Å)', fontsize=12)
ax.set_ylabel('Absolute Error vs FCI (eV)', fontsize=12)
ax.set_title('Quantum Computing Accuracy Across Dissociation Curve', fontsize=14)
ax.legend(fontsize=10)
ax.set_yscale('log')
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
# Example 3: Analyze entanglement entropy
plt.figure(figsize=(10, 6))
plt.plot(df['bond_length_angstrom'].to_numpy(),
df['entropy_fci'].to_numpy(),
label='FCI', linewidth=2)
plt.plot(df['bond_length_angstrom'].to_numpy(),
df['entropy_ccsd'].to_numpy(),
label='CCSD', linestyle='--')
plt.plot(df['bond_length_angstrom'].to_numpy(),
df['entropy_cs_dd_5q'].to_numpy(),
label='CS-DD', linestyle='-.', color='blue')
# Highlight experimental geometries
exp_entropy = df.filter(pl.col('has_experimental_data'))['entropy_fci'].to_numpy()
plt.scatter(df_exp['bond_length_angstrom'].to_numpy(),
exp_entropy,
color='red', s=100, zorder=5, label='Experimental geometries')
plt.xlabel('Bond Length (Å)', fontsize=12)
plt.ylabel('von Neumann Entropy', fontsize=12)
plt.title('Entanglement Entropy Along Dissociation Curve', fontsize=14)
plt.legend(fontsize=10)
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
@article{weaving2024contextual,
title={Contextual Subspace Variational Quantum Eigensolver Calculation of the Dissociation Curve of Molecular Nitrogen on a Superconducting Quantum Computer},
author={Weaving, Tim and others},
journal={npj Quantum Information},
year={2024},
publisher={Nature Publishing Group},
doi={10.1038/s41534-024-00952-4}
}