proof_engine/quantum/
mod.rs1pub mod schrodinger;
9pub mod wavefunction;
10pub mod tunneling;
11pub mod harmonic;
12pub mod hydrogen;
13pub mod double_slit;
14pub mod entanglement;
15pub mod spin;
16pub mod measurement;
17pub mod computing;
18
19pub use schrodinger::{Complex, WaveFunction1D, SchrodingerSolver1D, SchrodingerSolver2D};
20pub use wavefunction::{
21 gaussian_wavepacket, plane_wave, momentum_space, wigner_function,
22 WaveFunctionRenderer1D, WaveFunctionRenderer2D, DensityMatrix, PhaseColorMap,
23};
24pub use tunneling::{RectangularBarrier, transmission_coefficient, TunnelingSimulation, TunnelingResult};
25pub use harmonic::{qho_energy, qho_wavefunction, hermite_polynomial};
26pub use hydrogen::{hydrogen_energy, hydrogen_orbital, spherical_harmonic};
27pub use double_slit::{DoubleSlitSetup, intensity_pattern};
28pub use entanglement::{QubitState, TwoQubitState, bell_state};
29pub use spin::{SpinState, bloch_angles, from_bloch};
30pub use measurement::{MeasurementBasis, measure, BornRule};
31pub use computing::{QuantumRegister, QuantumGate, QuantumCircuit};
32
33#[cfg(test)]
34mod tests {
35 use super::*;
36
37 #[test]
38 fn test_module_imports() {
39 let c = Complex::new(1.0, 0.0);
40 assert!((c.norm() - 1.0).abs() < 1e-10);
41 }
42
43 #[test]
44 fn test_hydrogen_ground_state_energy() {
45 let e = hydrogen_energy(1);
46 assert!((e - (-13.6)).abs() < 0.01);
47 }
48
49 #[test]
50 fn test_qho_ground_state() {
51 let e = qho_energy(0, 1.0, 1.0);
52 assert!((e - 0.5).abs() < 1e-10);
53 }
54}