-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from ionq/bugfix-lindblad-modelnoise-basis
Fixes bug where depolarizing noise strength differs with parameterization
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from pygsti.processors import QubitProcessorSpec | ||
from pygsti.models import create_crosstalk_free_model | ||
from pygsti.circuits import Circuit | ||
from pygsti.modelmembers.operations.opfactory import ComposedOpFactory | ||
from pygsti.modelmembers.operations.depolarizeop import DepolarizeOp | ||
|
||
from ..util import BaseCase | ||
|
||
|
||
class ModelNoiseTester(BaseCase): | ||
def test_linblad_agrees_with_depol(self): | ||
pspec = QubitProcessorSpec(1, ["Gi"], geometry="line") | ||
|
||
mdl1 = create_crosstalk_free_model( | ||
pspec, | ||
depolarization_parameterization="lindblad", | ||
depolarization_strengths={'Gi': 0.02} | ||
) | ||
|
||
mdl2 = create_crosstalk_free_model( | ||
pspec, | ||
depolarization_parameterization="depolarize", | ||
depolarization_strengths={'Gi': 0.02} | ||
) | ||
|
||
c = Circuit("Gi:0@(0)") | ||
p1 = mdl1.probabilities(c) | ||
p2 = mdl2.probabilities(c) | ||
self.assertAlmostEqual(p1['0'], p2['0'], places=3) | ||
self.assertAlmostEqual(p1['1'], p2['1'], places=3) |