Skip to content

workbench_algorithms.utils.symbolic_paulimask

Module for initialising and manipulating symbolic sums of Pauli masks (e.g. local qubit Hamiltonians).

SymbolicPauliMask

SymbolicPauliMask(x_weight=None, z_weight=None)

Symbolic version of a PauliMask object.

For symbolics, the only relevant info one might need to extract from a PauliMask is the number of Pauli Xs and the number of Pauli Zs.

Notes

If both x_weight and z_weight default to None, other methods in classes and functions that make use of this class will assume the worse-case scenario where we have a string of Y gates on all qubits.

Parameters:

Name Type Description Default
x_weight (Optional, Parameter)

The number of Pauli Xs. Defaults to None.

None
z_weight (Optional, Parameter)

The number of Pauli Zs. Defaults to None.

None

SymbolicPauliSum

SymbolicPauliSum(
    num_terms: int | Parameter,
    average_x_weight: NumberOrParam = 0,
    average_y_weight: NumberOrParam = 0,
    average_z_weight: NumberOrParam = 0,
)

Symbolic version of a PauliSum object.

Given that we can't model exact weights in a Pauli sum symbolically, we model it using average weight values. Information we have - the number of terms in the sum - the average number of Pauli Xs - the average number of Pauli Ys - the average number of Pauli Zs

Notes
  • Weights used here are non-overlapping, so X weight means "X weight not overlapping with either Y or Z".

Parameters:

Name Type Description Default
num_terms int | Parameter

The number of terms in the sum of Paulis.

required
average_x_weight NumberOrParam

The (average) number of Pauli Xs. Defaults to 0.

0
average_y_weight NumberOrParam

The (average) number of Pauli Ys. Defaults to 0.

0
average_z_weight NumberOrParam

The (average) number of Pauli Zs. Defaults to 0.

0