Simon
class Simon(oracle, quantum_instance=None)
The Simon algorithm.
The Simon algorithm finds a hidden integer from an oracle that satisfies if and only if for all . Thus, if , i.e., the all-zero bitstring, then is a 1-to-1 (or, permutation) function. Otherwise, if , then 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 component - quantum_instance (
Union
[QuantumInstance
,BaseBackend
,None
]) – Quantum Instance or Backend
Attributes
backend
quantum_instance
Type: Union[None, qiskit.aqua.quantum_instance.QuantumInstance]
Returns quantum instance.
Return type
Optional
[QuantumInstance
]
random
Return a numpy random.
Methods
construct_circuit
Simon.construct_circuit(measurement=False)
Construct the quantum circuit
Parameters
measurement (bool) – Boolean flag to indicate if measurement should be included in the circuit.
Returns
the QuantumCircuit object for the constructed circuit
Return type
run
Simon.run(quantum_instance=None, **kwargs)
Execute the algorithm with selected backend.
Parameters
- quantum_instance (
Union
[QuantumInstance
,BaseBackend
,None
]) – the experimental setting. - kwargs (dict) – kwargs
Returns
results of an algorithm.
Return type
dict
Raises
AquaError – If a quantum instance or backend has not been provided
set_backend
Simon.set_backend(backend, **kwargs)
Sets backend with configuration.
Return type
None