pub struct ReferenceSimulator { /* private fields */ }Expand description
v2.4.0 — a usable dense-statevector simulator over f64 complex
amplitudes, capped at OSS_QUBIT_CAP.
Implementations§
Source§impl ReferenceSimulator
impl ReferenceSimulator
pub fn new() -> Self
Sourcepub fn reupload_encode(
&self,
x: &[f64],
layers: usize,
) -> Result<StateVector, QuantError>
pub fn reupload_encode( &self, x: &[f64], layers: usize, ) -> Result<StateVector, QuantError>
v2.23.0 — data re-uploading: interleave an angle-encoding of x
with a fixed entangling layer, layers times. For layers ≥ 2 the data
x re-enters the circuit, so ⟨ψ(x)|ψ(y)⟩ is NO LONGER a quadratic form in
x (it becomes a Fourier series in the data — Schuld 2021,
arXiv:2008.08605). This is the ONLY provable escape from the amplitude+Pauli
quadratic bound (v2.23.0 / the Havlíček route). layers = 1 reduces to a
single angle layer (no re-uploading). HONEST: escaping the bound does NOT
guarantee advantage on classical text — the v2.23.0 Advantage Witness still
gates it.
Source§impl ReferenceSimulator
impl ReferenceSimulator
Sourcepub fn polynomial_kernel(
a: &StateVector,
b: &StateVector,
degree: u32,
) -> Result<f64, QuantError>
pub fn polynomial_kernel( a: &StateVector, b: &StateVector, degree: u32, ) -> Result<f64, QuantError>
v2.23.0 — multi-copy polynomial kernel (xᵀy)^d. Loading d copies
of the state gives ⟨ψ(x)|ψ(y)⟩^d = (xᵀy)^d for amplitude encoding (Schuld
& Killoran). It reaches beyond cosine (degree 1) — but it is still a
CLASSICAL polynomial kernel (no quantum advantage), so like every fixed
amplitude map it is gated by the v2.23.0 Advantage Witness. degree = 0 is
the constant kernel 1; degree = 1 is the linear/cosine kernel xᵀy.
Trait Implementations§
Source§impl Clone for ReferenceSimulator
impl Clone for ReferenceSimulator
Source§fn clone(&self) -> ReferenceSimulator
fn clone(&self) -> ReferenceSimulator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReferenceSimulator
impl Debug for ReferenceSimulator
Source§impl Default for ReferenceSimulator
impl Default for ReferenceSimulator
Source§impl QuantBackend for ReferenceSimulator
impl QuantBackend for ReferenceSimulator
Source§fn encode(
&self,
x: &[f64],
scheme: EncodingScheme,
) -> Result<StateVector, QuantError>
fn encode( &self, x: &[f64], scheme: EncodingScheme, ) -> Result<StateVector, QuantError>
Source§fn evolve(
&self,
state: StateVector,
circuit: &VariationalCircuit,
) -> Result<StateVector, QuantError>
fn evolve( &self, state: StateVector, circuit: &VariationalCircuit, ) -> Result<StateVector, QuantError>
U(θ) (section 3.2).Source§fn measure(
&self,
state: &StateVector,
observable: &PauliSum,
) -> Result<f64, QuantError>
fn measure( &self, state: &StateVector, observable: &PauliSum, ) -> Result<f64, QuantError>
E(θ) = ⟨ψ| M |ψ⟩ of a Pauli-sum observable (real, since M is
Hermitian).Source§fn kernel(&self, a: &StateVector, b: &StateVector) -> Result<f64, QuantError>
fn kernel(&self, a: &StateVector, b: &StateVector) -> Result<f64, QuantError>
K = |⟨ψ_a|ψ_b⟩|² (section 3.4, fidelity kernel).