Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

LinearRotation

LinearRotation(slope, offset, num_state_qubits, basis='Y', i_state=None, i_target=None)

GitHub(opens in a new tab)

DEPRECATED. Linearly-controlled X, Y or Z rotation.

Deprecated since version 0.7.0

Use Terra’s qiskit.circuit.library.LinearPauliRotations instead.

For a register of state qubits |x> and a target qubit |0> this operator acts as:

|x>|0> –> |x>( cos(slope * x + offset)|0> + sin(slope * x + offset)|1> )

Parameters

  • slope (float) – slope of the controlled rotation
  • offset (float) – offset of the controlled rotation
  • num_state_qubits (int) – number of qubits representing the state
  • basis (str) – type of Pauli rotation (‘X’, ‘Y’, ‘Z’)
  • i_state (Optional(Union(list, numpy.ndarray))) – indices of the state qubits (least significant to most significant)
  • i_target (Optional(int)) – index of target qubit

Raises

ValueError – invalid input


Attributes

num_target_qubits

Returns the number of target qubits


Methods

build

LinearRotation.build(qc, q, q_ancillas=None, params=None)

Adds corresponding sub-circuit to given circuit

Parameters

  • qc (QuantumCircuit) – quantum circuit
  • q (list) – list of qubits (has to be same length as self._num_qubits)
  • q_ancillas (list) – list of ancilla qubits (or None if none needed)
  • params (list) – parameters for circuit

build_controlled

LinearRotation.build_controlled(qc, q, q_control, q_ancillas=None, use_basis_gates=True)

Adds corresponding controlled sub-circuit to given circuit

Parameters

  • qc (QuantumCircuit) – quantum circuit
  • q (list) – list of qubits (has to be same length as self._num_qubits)
  • q_control (Qubit) – control qubit
  • q_ancillas (list) – list of ancilla qubits (or None if none needed)
  • use_basis_gates (bool) – use basis gates for expansion of controlled circuit

build_controlled_inverse

LinearRotation.build_controlled_inverse(qc, q, q_control, q_ancillas=None, use_basis_gates=True)

Adds controlled inverse of corresponding sub-circuit to given circuit

Parameters

  • qc (QuantumCircuit) – quantum circuit
  • q (list) – list of qubits (has to be same length as self._num_qubits)
  • q_control (Qubit) – control qubit
  • q_ancillas (list) – list of ancilla qubits (or None if none needed)
  • use_basis_gates (bool) – use basis gates for expansion of controlled circuit

build_controlled_inverse_power

LinearRotation.build_controlled_inverse_power(qc, q, q_control, power, q_ancillas=None, use_basis_gates=True)

Adds controlled, inverse, power of corresponding circuit. May be overridden if a more efficient implementation is possible

build_controlled_power

LinearRotation.build_controlled_power(qc, q, q_control, power, q_ancillas=None, use_basis_gates=True)

Adds controlled power of corresponding circuit. May be overridden if a more efficient implementation is possible

build_inverse

LinearRotation.build_inverse(qc, q, q_ancillas=None)

Adds inverse of corresponding sub-circuit to given circuit

Parameters

  • qc (QuantumCircuit) – quantum circuit
  • q (list) – list of qubits (has to be same length as self._num_qubits)
  • q_ancillas (list) – list of ancilla qubits (or None if none needed)

build_inverse_power

LinearRotation.build_inverse_power(qc, q, power, q_ancillas=None)

Adds inverse power of corresponding circuit. May be overridden if a more efficient implementation is possible

build_power

LinearRotation.build_power(qc, q, power, q_ancillas=None)

Adds power of corresponding circuit. May be overridden if a more efficient implementation is possible

get_num_qubits

LinearRotation.get_num_qubits()

returns number of qubits

get_num_qubits_controlled

LinearRotation.get_num_qubits_controlled()

returns number of qubits controlled

required_ancillas

LinearRotation.required_ancillas()

returns required ancillas

required_ancillas_controlled

LinearRotation.required_ancillas_controlled()

returns required ancillas controlled

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