qat.spd.pauli_tableau.TableauSimulation
- class qat.spd.pauli_tableau.TableauSimulation(obs, **kwargs)
Implements sparse Pauli dynamics by evolving a PauliTableau representation of an observable through the Heisenberg picture
Several truncation methods are available:
threshold: discard Pauli rows with coefficients below this value (in absolute value)
max_weight: discard Pauli rows with Hamming weight above this value
max_size: truncate the tableau to this maximum size, keeping rows with the largest coefficients
max_x_weight: discard Pauli rows with more X or Y terms than this maximum
- Parameters:
obs (qat.core.Observable) – Observable to be evolved as a PauliTableau.
threshold (float, optional) – Minimum absolute coefficient to retain a Pauli row (default is 1e-16).
max_weight (int, optional) – Maximum allowed Hamming weight for the Pauli rows.
max_size (int, optional) – Maximum allowed number of Pauli rows in the tableau.
max_x_weight (int, optional) – Maximum allowed number of X or Y terms in a Pauli row.
nprocs (int, optional) – Number of processes to use for parallel execution (default is 1).
- nqbits
Number of qubits in the system.
- Type:
int
- observable
Heisenberg-evolved observable represented as a PauliTableau.
- Type:
- threshold
Threshold for filtering Pauli rows based on coefficient magnitude.
- Type:
float
- max_weight
Maximum Hamming weight for retained Pauli rows.
- Type:
int or None
- max_size
Maximum number of Pauli rows allowed in the tableau.
- Type:
int or None
- max_x_weight
Maximum number of X or Y terms allowed in a Pauli row.
- Type:
int or None
- nprocs
Number of processes used in parallel computations.
- Type:
int
- apply_rotation(pauli_rota, angle)
Apply a unitary Pauli rotation to the observable.
The rotation applied is defined as:
\[e^{i \frac{\theta}{2} \sigma} \mathcal{O} e^{-i \frac{\theta}{2} \sigma}\]Where \(\sigma\) is pauli_rota and \(\theta\) is angle.
The steps are:
Identify the set of Pauli rows in self.observable that anticommute with pauli_rota.
Compute new Pauli rows and update coefficients of existing Pauli rows.
Discard existing Pauli rows from self.observable that do not fit the truncation criteria
Insert new Pauli rows from new_paulis into self.observable if they fit the truncation criteria
If max_size is exceeded, remove the smallest coefficients until the size of the Pauli tableau is below max_size
- Parameters:
pauli_rota (PauliTableau) – The axis of the Pauli rotation
angle (float) – The angle of the rotation
- expectation_value()
Compute expectation value of the observable at the end of the circuit