pub struct ReferenceSimulator { /* private fields */ }Expand description
§Fase 51.e — 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>
§Fase 69.c — 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 (§69.b / 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 §69.a/b 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>
§Fase 69.d — 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 §69.a/b 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(θ) (§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⟩|² (§3.4, fidelity kernel).Auto Trait Implementations§
impl Freeze for ReferenceSimulator
impl RefUnwindSafe for ReferenceSimulator
impl Send for ReferenceSimulator
impl Sync for ReferenceSimulator
impl Unpin for ReferenceSimulator
impl UnsafeUnpin for ReferenceSimulator
impl UnwindSafe for ReferenceSimulator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more