BaseStateFidelity#

class qiskit.algorithms.state_fidelities.BaseStateFidelity[소스]#

기반 클래스: ABC

An interface to calculate state fidelities (state overlaps) for pairs of (parametrized) quantum circuits. The calculation depends on the particular fidelity method implementation, but can be always defined as the state overlap:

\[|\langle\psi(x)|\phi(y)\rangle|^2\]

where \(x\) and \(y\) are optional parametrizations of the states \(\psi\) and \(\phi\) prepared by the circuits circuit_1 and circuit_2, respectively.

Methods

abstract create_fidelity_circuit(circuit_1, circuit_2)[소스]#

Implementation-dependent method to create a fidelity circuit from 2 circuit inputs.

매개변수:
반환:

The fidelity quantum circuit corresponding to circuit_1 and circuit_2.

반환 형식:

QuantumCircuit

run(circuits_1, circuits_2, values_1=None, values_2=None, **options)[소스]#

Runs asynchronously the state overlap (fidelity) calculation between two (parametrized) circuits (first and second) for a specific set of parameter values (first and second). This calculation depends on the particular fidelity method implementation.

매개변수:
  • circuits_1 (QuantumCircuit | Sequence[QuantumCircuit]) – (Parametrized) quantum circuits preparing \(|\psi\rangle\).

  • circuits_2 (QuantumCircuit | Sequence[QuantumCircuit]) – (Parametrized) quantum circuits preparing \(|\phi\rangle\).

  • values_1 (Sequence[float] | Sequence[Sequence[float]] | None) – Numerical parameters to be bound to the first set of circuits.

  • values_2 (Sequence[float] | Sequence[Sequence[float]] | None) – Numerical parameters to be bound to the second set of circuits.

  • options – Primitive backend runtime options used for circuit execution. The order of priority is: options in run method > fidelity’s default options > primitive’s default setting. Higher priority setting overrides lower priority setting.

반환:

Primitive job for the fidelity calculation. The job’s result is an instance of StateFidelityResult.

반환 형식:

AlgorithmJob