Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

Simon

Simon(oracle, quantum_instance=None)

GitHub(opens in a new tab)

The Simon algorithm.

The Simon algorithm finds a hidden integer s{0,1}ns \in \{0,1\}^n from an oracle fsf_s that satisfies fs(x)=fs(y)f_s(x) = f_s(y) if and only if y=xsy=x \oplus s for all x{0,1}nx \in \{0,1\}^n. Thus, if s=00s = 0\ldots 0, i.e., the all-zero bitstring, then fsf_s is a 1-to-1 (or, permutation) function. Otherwise, if s00s \neq 0\ldots 0, then fsf_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


Attributes

backend

qiskit.providers.basebackend.BaseBackend

Returns backend.

Return type

BaseBackend

quantum_instance

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

QuantumCircuit

run

Simon.run(quantum_instance=None, **kwargs)

Execute the algorithm with selected backend.

Parameters

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

Was this page helpful?
Report a bug or request content on GitHub.