Japanese
言語
English
Japanese
German
Korean
Portuguese, Brazilian
French
Shortcuts

qiskit.aqua.algorithms.BernsteinVazirani

class BernsteinVazirani(oracle, quantum_instance=None)[ソース]

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)\).

パラメータ
  • oracle (Oracle) – The oracle component

  • quantum_instance (Union[QuantumInstance, Backend, BaseBackend, None]) – Quantum Instance or Backend

__init__(oracle, quantum_instance=None)[ソース]
パラメータ
  • oracle (Oracle) – The oracle component

  • quantum_instance (Union[QuantumInstance, Backend, BaseBackend, None]) – Quantum Instance or Backend

Methods

__init__(oracle[, quantum_instance])

type oracle

Oracle

construct_circuit([measurement])

Construct the quantum circuit

run([quantum_instance])

Execute the algorithm with selected backend.

set_backend(backend, **kwargs)

Sets backend with configuration.

Attributes

backend

Returns backend.

quantum_instance

Returns quantum instance.

random

Return a numpy random.

property backend

Returns backend.

戻り値の型

Union[Backend, BaseBackend]

construct_circuit(measurement=False)[ソース]

Construct the quantum circuit

パラメータ

measurement (bool) – Boolean flag to indicate if measurement should be included in the circuit.

戻り値

the QuantumCircuit object for the constructed circuit

戻り値の型

QuantumCircuit

property quantum_instance

Returns quantum instance.

戻り値の型

Optional[QuantumInstance]

property random

Return a numpy random.

run(quantum_instance=None, **kwargs)

Execute the algorithm with selected backend.

パラメータ
  • quantum_instance (Union[QuantumInstance, Backend, BaseBackend, None]) – the experimental setting.

  • kwargs (dict) – kwargs

戻り値

results of an algorithm.

戻り値の型

dict

例外

AquaError – If a quantum instance or backend has not been provided

set_backend(backend, **kwargs)

Sets backend with configuration.

戻り値の型

None