Comments (2)
Good question - there are a couple things you need to do differently to compute the diamond norm you're after:
- pyGSTi's
diamonddist
function operates on the "superoperator" or "Pauli Transfer Matrix" form of the gate, not the Choi form (in which a Pauli channel is diagonal) - so you need to convert your diagonal Choi matrices to the superoperator form usingjamiolkowski_iso
. - pyGSTi's Pauli basis matrices are normalized to 1.0 rather than d (the dimension of the Hilbert space, so 2 for a single qubit) as they are in https://arxiv.org/abs/1109.6887, so you need to convert between normalizations by multiplying by a factor of 22 = 4. The exponent of 2 comes from the fact that each element of
pr1
orpr2
is the coefficient of a term like Pi rho Pi in which there are 2 Paulis.
So the following will give you what you're after:
import numpy as np
pr1 = np.array([0.2,0.3,0.2,0.3]) # understood to be in basis of norm=2 Paulis
pr2 = np.array([0.5,0.4,0.05,0.05])
import pygsti
g1 = pygsti.tools.jamiolkowski_iso(4*np.diag(pr1), 'pp','pp')
g2 = pygsti.tools.jamiolkowski_iso(4*np.diag(pr2), 'pp','pp')
pygsti.gatetools.diamonddist(g1,g2,mxBasis='pp')
This gives the 0.8 you expect.
from pygsti.
Thanks, figured it was some different normalization issue.
from pygsti.
Related Issues (20)
- Audit code for use of list comprehensions where generators would be faster HOT 2
- Forward Simulator Dprobs Bugs with Instruments
- Audit usage of linalg.inv
- Error gen projection basis must be Basis object HOT 1
- Method `parameter_labels()` returns an empty array HOT 1
- 1/2 Diamond Norm Errorbars
- Raw Estimates Errorbars for TPInstrument HOT 1
- CP Instruments & Instrument Error Generators
- QI Report Fixes & Additions
- Wildcard w/ QILGST
- Fisher Information w/ Experiment Designs Containing MCMs
- Explicit Model Construction from MCM-Containing Pspec
- Help with detecting crosstalk errors of simulated data
- Serialization Issue w/ Processor Spec Nonstd_Instruments HOT 1
- Numpy version dependency HOT 1
- Gswap cannot be used as a two-qubit standard native gate for two-qubit RB as CliffordCompilationRules taking too long
- Line label reordering during `Circuit` concatenation
- Generating Random Error Generators HOT 4
- Design pspec sslbl bug in modelpacks
- Serialization for ModelEstimateResults HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygsti.