Skip to main content

Module algorithm

Module algorithm 

Source
Expand description

Canonical quantum algorithms built on the state-vector simulator.

This module collects textbook oracle-based and communication algorithms that showcase quantum advantage on top of the primitives in crate::statevec and crate::gates:

  • grover — Grover’s unstructured search (quadratic query speed-up).
  • deutsch_jozsa — single-query constant-vs-balanced decision.
  • bernstein_vazirani — single-query hidden-string recovery.
  • teleportation — single-qubit state transfer via a Bell pair + 2 cbits.
  • superdense — two classical bits sent through one qubit + a Bell pair.
  • simon — exponential-speed-up hidden-period recovery (Shor precursor).
  • shor — order-finding subroutine + classical factoring reduction.
  • error_correction — GHZ/W state prep + 3-qubit bit/phase-flip codes.

Re-exports§

pub use bernstein_vazirani::BernsteinVaziraniResult;
pub use bernstein_vazirani::bernstein_vazirani;
pub use deutsch_jozsa::DeutschJozsaResult;
pub use deutsch_jozsa::FunctionKind;
pub use deutsch_jozsa::deutsch_jozsa;
pub use error_correction::bit_flip_correct;
pub use error_correction::bit_flip_encode;
pub use error_correction::phase_flip_correct;
pub use error_correction::phase_flip_encode;
pub use error_correction::prepare_ghz;
pub use error_correction::prepare_w;
pub use grover::GroverResult;
pub use grover::marked_probability;
pub use grover::optimal_iterations;
pub use shor::OrderFindingResult;
pub use shor::ShorResult;
pub use shor::classical_order;
pub use shor::continued_fraction_convergents;
pub use shor::factor_from_order;
pub use shor::gcd;
pub use shor::mod_exp;
pub use shor::order_finding;
pub use shor::shor_factor;
pub use simon::SimonResult;
pub use simon::recover_period_from_constraints;
pub use simon::simon;
pub use superdense::SuperdenseResult;
pub use superdense::superdense_decode;
pub use swap_test::hadamard_test;
pub use swap_test::swap_test;
pub use teleportation::TeleportResult;
pub use teleportation::teleport;

Modules§

bernstein_vazirani
Bernstein–Vazirani algorithm.
deutsch_jozsa
Deutsch–Jozsa algorithm.
error_correction
Multi-qubit entangled-state preparation and 3-qubit quantum error correction.
grover
Grover’s unstructured search algorithm.
shor
Shor’s period-finding subroutine.
simon
Simon’s algorithm.
superdense
Superdense coding.
swap_test
Ancilla-interference primitives: the SWAP test and the Hadamard test.
teleportation
Quantum teleportation.