get_z_basis

Contents

get_z_basis#

iqm.qaoa.tree_calculation.generate_basis.get_z_basis(p)[source]#

Generate an array containing the Z basis on a qubit.

The Z basis basically means “all possible combinations of +1 and -1”, multiple times. In the calcultion, this comes from resolutions of identity between the QAOA layers, which is why the Z basis has \(2^{2p+1}\) elements.

Parameters:

p (int) – The number of QAOA layers.

Returns:

A numpy array of size \(2^{2p+1}\) containing the basis on the RCC.

Return type:

ndarray[tuple[Any, …], dtype[int8]]