quantum_launcher.hampy.utils

quantum_launcher.hampy.utils#

Utility functions for Hampy objects.

Summary#

Functions:

shift_affected_qubits

Shifts the qubits affected by the equation by the given amount, wrapping around if the index goes out of bounds.

Reference#

quantum_launcher.hampy.utils.shift_affected_qubits(equation: Equation, shift: int) Equation[source]#

Shifts the qubits affected by the equation by the given amount, wrapping around if the index goes out of bounds.

For each Pauli in the equation hamiltonian, shifts the Pauli string by the given amount. i.e (shift = 1) IZIZ -> ZIZI, etc. !Might be unwanted! ZIII -> IIIZ Keeps the coefficients the same.

Parameters:
  • equation (Equation) – Equation to shift

  • shift (int) – Amount to shift by

Returns:

New equation affecting the shifted qubits

Return type:

Equation