pair

Contents

pair#

iqm.qaoa.tree_calculation.tree_calculation.pair(ai, aj, beta_i)#

Represents the equation (A12) in [7].

Returns the expectation value of \(\langle z^{[m]}_k | e^{i\beta_i X_k} | z^{[n]}_k \rangle}\) where the ket and the bra are basis states and the operator is the exponentiation of the mixer.

Parameters:
  • ai (int) – The basis state of the bra vector, must be either +1 or -1.

  • aj (int) – The basis state of the ket vector, must be either +1 or -1.

  • beta_i (float64) – The angle by which the \(X_k\) operator gets exponentiated.

Returns:

The right-hand side of the equation (A12). In other words, the cosine of beta_i if aj and ai are equal and the imaginary sine of beta_i otherwise.

Raises:

ValueError – If the input variables ai or aj aren’t either +1 or -1.

Return type:

complex128