BernsteinVazirani

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

The Bernstein-Vazirani algorithm.

The Bernstein-Vazirani algorithm is an extension / restriction of the Deutsch-Jozsa algorithm. The goal of the algorithm is to determine a secret string \(s \in \{0,1\}^n\), given a black box oracle function, that maps \(f:\{0,1\}^n \rightarrow \{0,1\}\) such that \(f(x)=s \cdot x (\bmod 2)\).

Parameters

Attributes

BernsteinVazirani.backend

Returns backend.

BernsteinVazirani.quantum_instance

Returns quantum instance.

BernsteinVazirani.random

Return a numpy random.

Methods

BernsteinVazirani.construct_circuit([…])

Construct the quantum circuit

BernsteinVazirani.run([quantum_instance])

Execute the algorithm with selected backend.

BernsteinVazirani.set_backend(backend, **kwargs)

Sets backend with configuration.