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:
- 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