loom.eka.utilities.pauli_commutation

Copyright (c) Entropica Labs Pte Ltd 2025.

Use, distribution and reproduction of this program in its source or compiled form is prohibited without the express written consent of Entropica Labs Pte Ltd.

loom.eka.utilities.pauli_commutation.anti_commutes_npfunc(x1, z1, x2, z2)[source]

Vectorized anti-commutation function.

Parameters:
  • x1 (np.ndarray) – The x bits of the first pauli string.

  • z1 (np.ndarray) – The z bits of the first pauli string.

  • x2 (np.ndarray) – The x bits of the second pauli string.

  • z2 (np.ndarray) – The z bits of the second pauli string.

Returns:

The anti-commutation values.

Return type:

np.ndarray

loom.eka.utilities.pauli_commutation.paulis_anti_commute(x1, z1, x2, z2)[source]

Calculates the anti-commutation value of two pauli operators.

A value of 0 means that the paulis commute while a value of 1 means that they anti-commute.

Return type:

int