qml.pauli.qwc_complement_adj_matrix

qwc_complement_adj_matrix(binary_observables)[source]

Obtains the adjacency matrix for the complementary graph of the qubit-wise commutativity graph for a given set of observables in the binary representation.

The qubit-wise commutativity graph for a set of Pauli words has a vertex for each Pauli word, and two nodes are connected if and only if the corresponding Pauli words are qubit-wise commuting.

Parameters

binary_observables (array[array[int]]) – a matrix whose rows are the Pauli words in the binary vector representation

Returns

the adjacency matrix for the complement of the qubit-wise commutativity graph

Return type

array[array[int]]

Raises

ValueError – if input binary observables contain components which are not strictly binary

Example

>>> binary_observables
array([[1., 0., 1., 0., 0., 1.],
       [0., 1., 1., 1., 0., 1.],
       [0., 0., 0., 1., 0., 0.]])
>>> qwc_complement_adj_matrix(binary_observables)
array([[0., 1., 1.],
       [1., 0., 0.],
       [1., 0., 0.]])