BalancedUniformPauli
class samplomatic.distributions.BalancedUniformPauli(num_subsystems: int)
Bases: Distribution
The balanced uniform distribution over virtual Pauli gates.
Here, balanced means that on every qubit, each of the four Paulis appears the same number of times, provided that the requested number of samples is a multiple of four. Moreover, when the number of samples is a multiple of two, it is promised that, for each qubit, X or Y is sampled the same number of times as I or Z.
The sampling algorithm is simply to draw four times fewer n-qubit Paulis uniformly and iid than requested, and then replicate each four times with respective multiplications by , , , and , truncating the samples if their requested number is not a multiple of four. Randomizations are ordered such that the four replications are consecutive. The particular ordering of the four multiplicative terms— then then then —is what provides the guarantee that for each qubit, X or Y is sampled the same number of times as I or Z, even if the number of samples is even but not a multiple of four.
Parameters
num_subsystems – The number of subsystems this distribution samples.
Attributes Summary
Column 1 | Column 2 |
|---|---|
register_type | The virtual gate type being sampled. |
Methods Summary
Column 1 | Column 2 |
|---|---|
sample(size, rng) | Sample the distribution. |
Attributes Documentation
register_type
Methods Documentation
sample
sample(size, rng)
Sample the distribution.
Parameters
- size – The number elements to sample.
- rng – A randomness generator.
Returns
The samples.