Möttönen State Preparation

This module implements the state preparation scheme defined by Möttönen et. al. (http://dl.acm.org/citation.cfm?id=2011670.2011675)

dc_qiskit_algorithms.MöttönenStatePreparation.get_alpha_z(omega, n, k)[source]

Computes the rotation angles alpha for the z-rotations

Parameters
  • omega (dok_matrix) – the input phase

  • n (int) – total number of qubits

  • k (int) – current qubit

Return type

dok_matrix

Returns

a sparse vector

dc_qiskit_algorithms.MöttönenStatePreparation.get_alpha_y(a, n, k)[source]

Computes the rotation angles alpha for the y-rotations

Parameters
  • a (dok_matrix) – the input absolute values

  • n (int) – total number of qubits

  • k (int) – current qubit

Return type

dok_matrix

Returns

a sparse vector

class dc_qiskit_algorithms.MöttönenStatePreparation.RZGateNegatedAngle(phi)[source]

Bases: qiskit.circuit.library.standard_gates.rz.RZGate

class dc_qiskit_algorithms.MöttönenStatePreparation.RYGateNegatedAngle(phi)[source]

Bases: qiskit.circuit.library.standard_gates.ry.RYGate

class dc_qiskit_algorithms.MöttönenStatePreparation.MöttönenStatePreparationGate(vector, neglect_absolute_value=False)[source]

Bases: qiskit.circuit.gate.Gate

Uniform rotation Y gate (Möttönen).

static apply_rot_y(a, qreg)[source]

Applies the cascade of y-uniform rotations to the qubits

Parameters
  • a (dok_matrix) – the sparse absolute value vector

  • qreg (QuantumRegister) – quantum register to which the scheme are applied

Return type

QuantumCircuit

Returns

None

static apply_rot_z(omega, qreg)[source]

Applies the cascade of z-uniform rotations to the qubits

Parameters
  • omega (dok_matrix) – the sparse phase vector

  • qreg (QuantumRegister) – quantum register to which the scheme are applied

Return type

QuantumCircuit

Returns

None

dc_qiskit_algorithms.MöttönenStatePreparation.state_prep_möttönen(self, a, qubits)[source]

Convenience function to encapsulate the composite gate of the state preparation

Parameters
  • self (QuantumCircuit) – Quantum circuit to apply this to

  • a (Union[List[float], dok_matrix]) – the input vector

  • qubits (Union[List[Qubit], QuantumRegister]) – the qubits to be transformed

Return type

Instruction

Returns

gate just added

dc_qiskit_algorithms.MöttönenStatePreparation.state_prep_möttönen_dg(self, a, qubits)[source]

Convenience function to encapsulate the composite gate of the dagger of the state preparation

Parameters
  • self (QuantumCircuit) – Composite Gate or Quantum circuit to apply this to

  • a (Union[List[float], dok_matrix]) – the input vector

  • qubits (Union[List[Qubit], QuantumRegister]) – the qubits to be transformed

Return type

Instruction

Returns

gate or instruction set