Skip to main contentIBM Quantum Documentation

excitation_preserving

class qiskit.circuit.library.excitation_preserving(num_qubits, mode='iswap', entanglement='full', reps=3, skip_unentangled_qubits=False, skip_final_rotation_layer=False, parameter_prefix='θ', insert_barriers=False, name='ExcitationPreserving')

GitHub

Bases:

The heuristic excitation-preserving wave function ansatz.

The excitation_preserving circuit preserves the ratio of 00|00\rangle, 01+10|01\rangle + |10\rangle and 11|11\rangle states. To this end, this circuit uses two-qubit interactions of the form

(10000cos(θ/2)isin(θ/2)00isin(θ/2)cos(θ/2)0000eiϕ)\providecommand{\rotationangle}{\theta/2} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos\left(\rotationangle\right) & -i\sin\left(\rotationangle\right) & 0 \\ 0 & -i\sin\left(\rotationangle\right) & \cos\left(\rotationangle\right) & 0 \\ 0 & 0 & 0 & e^{-i\phi} \end{pmatrix}

for the mode "fsim" or with eiϕ=1e^{-i\phi} = 1 for the mode "iswap".

Note that other wave functions, such as UCC-ansatzes, are also excitation preserving. However these can become complex quickly, while this heuristically motivated circuit follows a simpler pattern.

This trial wave function consists of layers of ZZ rotations with 2-qubit entanglements. The entangling is creating using XX+YYXX+YY rotations and optionally a controlled-phase gate for the mode "fsim".

Examples

With linear entanglement, this circuit is given by:

from qiskit.circuit.library import excitation_preserving
 
ansatz = excitation_preserving(3, reps=1, insert_barriers=True, entanglement="linear")
ansatz.draw("mpl")
../_images/qiskit-circuit-library-excitation_preserving-1.png

The entanglement structure can be explicitly specified with the entanglement argument. The "fsim" mode includes an additional parameterized CPhaseGate in each block:

ansatz = excitation_preserving(3, reps=1, mode="fsim", entanglement=[[0, 2]])
ansatz.draw("mpl")
../_images/qiskit-circuit-library-excitation_preserving-2_00.png../_images/qiskit-circuit-library-excitation_preserving-2_01.png

Parameters

  • num_qubits (int) – The number of qubits.
  • mode (str) – Choose the entangler mode, can be “iswap” or “fsim”.
  • reps (int) – Specifies how often the structure of a rotation layer followed by an entanglement layer is repeated.
  • entanglement (BlockEntanglement | Iterable[BlockEntanglement] | Callable[[int], BlockEntanglement | Iterable[BlockEntanglement]]) – The indices specifying on which qubits the input blocks act. See n_local() for detailed information.
  • skip_final_rotation_layer (bool) – Whether a final rotation layer is added to the circuit.
  • skip_unentangled_qubits (bool) – If True, the rotation gates act only on qubits that are entangled. If False, the rotation gates act on all qubits.
  • parameter_prefix (str) – The name of the free parameters.
  • insert_barriers (bool) – If True, barriers are inserted in between each layer. If False, no barriers are inserted.
  • name (str) – The name of the circuit.

Returns

An excitation-preserving circuit.

Was this page helpful?
Report a bug or request content on GitHub.