small_g#
- iqm.qaoa.tree_calculation.tree_calculation.small_g(m_minus_1, b, big_beta)#
Represents the function \(g(b^{(m-1)})\) defined in (A26) in [7].
For a given basis state b (i.e., an array of +1 and -1), this calculates the function \(g\). The function is a product of expectation values.
- Parameters:
m_minus_1 (int) – The parameter \(m-1\) from the text.
b (ndarray[tuple[Any, ...], dtype[int8]]) – The array of basis states of the ket and bra vector which appear in the definition of :math`g(b^{(m-1)})`. It is expected to have length 2*m_minus_1, but it can be longer because it’s accessed from left and right.
big_beta (ndarray[tuple[Any, ...], dtype[float64]]) – The array containing the beta angles of the QAOA, sorted ascendingly and descendingly in an array like \((\beta_1, \beta_2, ... , \beta_{p-1}, -\beta_{p-1}, -\beta_{p-2}, ..., -\beta_2, -\beta_1)\). Here \(p \geq m-1\) (but not necessarily equal).
- Returns:
math`g(b^{(m-1)})` function.
- Return type:
The value of the