Simon

class Simon(oracle, quantum_instance=None)[source]

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

Attributes

Simon.backend

Returns backend.

Simon.quantum_instance

Returns quantum instance.

Simon.random

Return a numpy random.

Methods

Simon.construct_circuit([measurement])

Construct the quantum circuit

Simon.run([quantum_instance])

Execute the algorithm with selected backend.

Simon.set_backend(backend, **kwargs)

Sets backend with configuration.