Simon¶
-
class
Simon
(oracle, quantum_instance=None)[source]¶ Bases:
qiskit.aqua.algorithms.quantum_algorithm.QuantumAlgorithm
The Simon algorithm.
The Simon algorithm finds a hidden integer \(s \in \{0,1\}^n\) from an oracle \(f_s\) that satisfies \(f_s(x) = f_s(y)\) if and only if \(y=x \oplus s\) for all \(x \in \{0,1\}^n\). Thus, if \(s = 0\ldots 0\), i.e., the all-zero bitstring, then \(f_s\) is a 1-to-1 (or, permutation) function. Otherwise, if \(s \neq 0\ldots 0\), then \(f_s\) is a 2-to-1 function.
Note: the
TruthTableOracle
may be the easiest to use to create one that can be used with the Simon algorithm.- Parameters
oracle (
Oracle
) – The oracle componentquantum_instance (
Union
[QuantumInstance
,Backend
,BaseBackend
,None
]) – Quantum Instance or Backend
Methods
Construct the quantum circuit
Execute the algorithm with selected backend.
Sets backend with configuration.
Attributes
-
backend
¶ Returns backend.
- Return type
Union
[Backend
,BaseBackend
]
-
quantum_instance
¶ Returns quantum instance.
- Return type
Optional
[QuantumInstance
]
-
random
¶ Return a numpy random.