German
Sprachen
English
Japanese
German
Korean
Portuguese, Brazilian
French
Shortcuts

qiskit.aqua.algorithms.DeutschJozsa

class DeutschJozsa(oracle, quantum_instance=None)[Quellcode]

The Deutsch-Jozsa algorithm.

The Deutsch-Jozsa algorithm was one of the first known quantum algorithms that showed an exponential speedup compared to a deterministic (non-probabilistic) classical algorithm, given a black box oracle function. The algorithm determines whether the given function \(f:\{0,1\}^n \rightarrow \{0,1\}\) is constant or balanced. A constant function maps all inputs to 0 or 1, and a balanced function maps half of its inputs to 0 and the other half to 1.

Note: the TruthTableOracle facilitates creating a constant or balanced function but any oracle can be used as long as the boolean function implemented by the oracle indeed satisfies the constraint of being either constant or balanced.

Parameter
  • oracle (Oracle) – The oracle component

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

__init__(oracle, quantum_instance=None)[Quellcode]
Parameter
  • 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.

Rückgabetyp

Union[Backend, BaseBackend]

construct_circuit(measurement=False)[Quellcode]

Construct the quantum circuit

Parameter

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

Rückgabe

the QuantumCircuit object for the constructed circuit

Rückgabetyp

QuantumCircuit

property quantum_instance

Returns quantum instance.

Rückgabetyp

Optional[QuantumInstance]

property random

Return a numpy random.

run(quantum_instance=None, **kwargs)

Execute the algorithm with selected backend.

Parameter
  • quantum_instance (Union[QuantumInstance, Backend, BaseBackend, None]) – the experimental setting.

  • kwargs (dict) – kwargs

Rückgabe

results of an algorithm.

Rückgabetyp

dict

Verursacht

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

set_backend(backend, **kwargs)

Sets backend with configuration.

Rückgabetyp

None