1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! # Quantum planning
//!
//! Quantum algorithms for planning and search, on simulators: Grover search, quantum backtracking, amplitude estimation, quantum walks on game trees and QAOA.
//!
//! ## Scope
//!
//! - A state-vector simulator ([`StateVector`]) with `H`, `X`, `Z`, phase and multi-controlled
//! `Z` gates, measurement probabilities and seeded sampling over any [`rand_core::Rng`]
//! - Grover search over candidate plans, with phase oracles ([`PhaseOracle`]) built from
//! validity checks, for a known ([`grover::search_known`]) and an unknown
//! ([`grover::search_unknown`], BBHT) number of solutions
//! - Quantum backtracking (Montanaro) as a quantum walk on search trees (planned)
//! - Amplitude estimation for Monte Carlo value estimates, as used in MCTS rollouts (planned)
//! - Quantum-walk evaluation of game trees (NAND trees) (planned)
//! - QAOA circuits for QUBO-encoded planning problems (planned)
//! - Query-count comparisons against the classical algorithms
//!
//! ## Query count
//!
//! The algorithms count oracle queries, not simulator work: one application of a
//! [`PhaseOracle`] is one query, and one classical check of a measured candidate is one
//! query. Compare these counts with the queries of a classical scan.
//!
//! The crate is `no_std` and needs `alloc` for the amplitudes.
//!
//! Repository: <https://github.com/sunsided/quantum-planning>
extern crate alloc;
pub use Complex;
pub use PhaseOracle;
pub use SplitMix64;
pub use ;
/// A predicate that marks valid candidates, the oracle of a quantum search.
///
/// The predicate must be pure: the same candidate always gets the same answer, since the
/// algorithms count oracle queries.
/// A reference to an oracle is an oracle, so a [`PhaseOracle`] can borrow one.
/// Doctests for the code examples in README.md (not part of the API).