From b47a9c6300ff6c8dff3e974e00250aa1765bcbc0 Mon Sep 17 00:00:00 2001 From: Corey Ostrove Date: Sun, 5 Jan 2025 17:53:31 -0700 Subject: [PATCH] Restrict specialization to unnormalized Paulis Actually, it looks like the change I implemented specializing the error generator construction when using paulis is actually only valid when using unnormalized ones. Could get it working for the other case by tracking the additional scale factor, but for now just revert partially. --- pygsti/tools/lindbladtools.py | 4 ++-- pygsti/tools/optools.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pygsti/tools/lindbladtools.py b/pygsti/tools/lindbladtools.py index 64632797b..a2dbdfa38 100644 --- a/pygsti/tools/lindbladtools.py +++ b/pygsti/tools/lindbladtools.py @@ -131,7 +131,7 @@ def create_elementary_errorgen_dual(typ, p, q=None, sparse=False, normalization_ def create_elementary_errorgen_dual_pauli(typ, p, q=None, sparse=False): """ Construct a "dual" elementary error generator matrix in the "standard" (matrix-unit) basis. - Specialized to p and q being elements of the pauli basis. + Specialized to p and q being elements of the (unnormalized) pauli basis. The elementary error generator that is dual to the one computed by calling :func:`create_elementary_errorgen` with the same argument. This dual element @@ -337,7 +337,7 @@ def create_elementary_errorgen(typ, p, q=None, sparse=False): def create_elementary_errorgen_pauli(typ, p, q=None, sparse=False): """ Construct an elementary error generator as a matrix in the "standard" (matrix-unit) basis. - Specialized to the case where p and q are elements of the pauli basis. + Specialized to the case where p and q are elements of the (unnormalized) pauli basis. There are four different types of elementary error generators: 'H' (Hamiltonian), 'S' (stochastic), 'C' (correlation), and 'A' (active). See arxiv:2103.01928. diff --git a/pygsti/tools/optools.py b/pygsti/tools/optools.py index c9f5cf5d1..958493b56 100644 --- a/pygsti/tools/optools.py +++ b/pygsti/tools/optools.py @@ -1988,8 +1988,7 @@ def _create_elementary_errorgen_nqudit(typ, basis_element_labels, basis_1q, norm #See docstrings for `bulk_create_elementary_errorgen_nqudit` and `bulk_create_elementary_errorgen_nqudit_dual`. #check if we're using the pauli basis - is_pauli = set(basis_1q.name.split('*')) == set(['PP']) or set(basis_1q.name.split('*')) == set(['pp']) - + is_pauli = set(basis_1q.name.split('*')) == set(['PP']) if create_dual: if is_pauli: create_fn = _lt.create_elementary_errorgen_dual_pauli