Skip to content

Commit

Permalink
Typos and deprecation tutorial fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sserita committed Aug 11, 2023
1 parent a0e4d5d commit bb0529a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions jupyter_notebooks/Tutorials/00-Protocols.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"metadata": {},
"source": [
"## Randomized benchmarking\n",
"Randomized benchmarking (RB) can be used to estimate the average per-Clifford error rate by fitting a simple curve to the data from randomized circuits of different depths. To create the experiment design, the user specifies a `QubitProcessorSpec` object that describes the quantum processor (see the [ProcessorSpec tutorial](objects/ProcessorSpec.pynb), the depths (in number of Clifford gates) to use, and the number of circuits at each depth. The results from running the protocol are then used to create a plot of the RB decay curve along with the data. For more information, see the [RB Overview tutorial](algorithms/RB-Overview.ipynb)."
"Randomized benchmarking (RB) can be used to estimate the average per-Clifford error rate by fitting a simple curve to the data from randomized circuits of different depths. To create the experiment design, the user specifies a `QubitProcessorSpec` object that describes the quantum processor (see the [ProcessorSpec tutorial](objects/ProcessorSpec.pynb)), the depths (in number of Clifford gates) to use, and the number of circuits at each depth. The results from running the protocol are then used to create a plot of the RB decay curve along with the data. For more information, see the [RB Overview tutorial](algorithms/RB-Overview.ipynb)."
]
},
{
Expand Down Expand Up @@ -234,7 +234,7 @@
"exp_design = smq1Q_Xpi2_rpe.create_rpe_experiment_design(max_max_length=64)\n",
"\n",
"# write an empty data object (creates a template to fill in)\n",
"pygsti.io.write_empty_protocol_data(exp_design, 'tutorial_files/test_rpe_dir', clobber_ok=True)\n",
"pygsti.io.write_empty_protocol_data('tutorial_files/test_rpe_dir', exp_design, clobber_ok=True)\n",
"\n",
"# fill in the template with simulated data (you would run the experiment and use actual data)\n",
"pygsti.io.fill_in_empty_dataset_with_fake_data(\n",
Expand Down Expand Up @@ -332,7 +332,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 5 additions & 3 deletions jupyter_notebooks/Tutorials/01-Essential-Objects.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Another thing to note is that `DataSet` objects are \"sparse\" in that 0-counts are not typically stored:"
"Another thing to note is that `DataSet` objects can be made \"sparse\" by dropping 0-counts:"
]
},
{
Expand All @@ -352,9 +352,11 @@
"metadata": {},
"outputs": [],
"source": [
"ds_sparse = ds_fake.drop_zero_counts()\n",
"\n",
"c = Circuit([('Gxpi2',0)], line_labels=(0,1))\n",
"print(\"No 01 or 11 outcomes here: \",ds_fake[c])\n",
"for outlbl, cnt in ds_fake[c].counts.items():\n",
"for outlbl, cnt in ds_sparse[c].counts.items():\n",
" print(\"Item: \",outlbl, cnt) # Note: this loop never loops over 01 or 11!"
]
},
Expand Down Expand Up @@ -411,7 +413,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"metadata": {},
"source": [
"## Randomized Benchmarking (RB)\n",
"PyGSTi is able to perform two types of Randomized Benchmarking (RB). First, there is the [standard Clifford-circuit-based RB](http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.106.180504) protocol first defined by Magesan et al. Second, there is [\"Direct RB\"](https://arxiv.org/abs/1807.07975), which is particularly suited to multi-qubit benchmarking. More more details on using these protocols (e.g. how to generate a set of RB sequences) see the separate [RB overview tutorial](algorithms/RB-Overview.ipynb) and related tutorials."
"PyGSTi is able to perform two types of Randomized Benchmarking (RB). First, there is the [standard Clifford-circuit-based RB](http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.106.180504) protocol first defined by Magesan et al. Second, there is [\"Direct RB\"](https://arxiv.org/abs/1807.07975), which is particularly suited to multi-qubit benchmarking. More details on using these protocols (e.g. how to generate a set of RB sequences) see the separate [RB overview tutorial](algorithms/RB-Overview.ipynb) and related tutorials."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
" \n",
" theta = (np.pi/2 + self.over_rotation)/2\n",
" a = 1.0-self.depol_amt\n",
" b = a*2*np.cos(theta)*np.sin(theta)\n",
" c = a*(np.sin(theta)**2 - np.cos(theta)**2)\n",
" b = a*np.sin(2*theta)\n",
" c = a*np.cos(2*theta)\n",
" \n",
" # ._ptr is a member of DenseOperator and is a numpy array that is \n",
" # the dense Pauli transfer matrix of this operator\n",
Expand All @@ -65,7 +65,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We'll add a `MyXPi2Operator` instance as the `\"Gx\"` gate in pyGSTi's standard {Idle, $X(\\pi/2)$, $Y(\\pi/2)$} model (see the [standard modules tutorial](StandardModules.ipynb) for more information on standard models)."
"We'll add a `MyXPi2Operator` instance as the `(\"Gxpi2\",0)` gate in pyGSTi's {Idle, $X(\\pi/2)$, $Y(\\pi/2)$} modelpack (see the [modelpacks tutorial](ModelPacks.ipynb) for more information on modelpacks)."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions pygsti/data/datacomparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ def run(self, significance=0.05, per_circuit_correction='Hochberg',
if self.inconsistent_datasets_detected:
print("The data are INCONSISTENT at {0:.2f}% significance.".format(self.significance * 100))
print(" - Details:")
print(" - The aggregate log-_likelihood ratio test is "
print(" - The aggregate log-likelihood ratio test is "
"significant at {0:.2f} standard deviations.".format(self._aggregate_nsigma))
print(" - The aggregate log-_likelihood ratio test "
print(" - The aggregate log-likelihood ratio test "
"standard deviations signficance threshold is {0:.2f}".format(self._aggregate_nsigma_threshold))
print(
" - The number of sequences with data that is "
Expand Down
18 changes: 9 additions & 9 deletions pygsti/protocols/gst.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def retrieve_model(self, edesign, gaugeopt_target, dataset, comm):
if comm is None or comm.Get_rank() == 0:
#Advanced Options can specify further manipulation of starting model
if self.contract_start_to_cptp:
mdl_start = _alg.contract(mdl_start, "CPTP")
mdl_start = _alg.contract(mdl_start, "CPTPLND")
raise ValueError(
"'contractStartToCPTP' has been removed b/c it can change the parameterization of a model")
if self.depolarize_start > 0:
Expand Down Expand Up @@ -1534,13 +1534,13 @@ class StandardGST(_proto.Protocol):
parameterizations/constraints to apply to the estimated model.
The default value is usually fine. Allowed values are:
- "full" : full (completely unconstrained)
- "TP" : TP-constrained
- "CPTP" : Lindbladian CPTP-constrained
- "H+S" : Only Hamiltonian + Stochastic errors allowed (CPTP)
- "S" : Only Stochastic errors allowed (CPTP)
- "Target" : use the target (ideal) gates as the estimate
- <model> : any key in the `models_to_test` argument
- "full" : full (completely unconstrained)
- "TP" : TP-constrained
- "CPTPLND" : Lindbladian CPTP-constrained
- "H+S" : Only Hamiltonian + Stochastic errors allowed (CPTP)
- "S" : Only Stochastic errors allowed (CPTP)
- "Target" : use the target (ideal) gates as the estimate
- <model> : any key in the `models_to_test` argument
gaugeopt_suite : GSTGaugeOptSuite, optional
Specifies which gauge optimizations to perform on each estimate. Can also
Expand Down Expand Up @@ -1581,7 +1581,7 @@ class StandardGST(_proto.Protocol):
be used.
"""

def __init__(self, modes="full TP,CPTP,Target", gaugeopt_suite='stdgaugeopt', target_model=None,
def __init__(self, modes="full TP,CPTPLND,Target", gaugeopt_suite='stdgaugeopt', target_model=None,
models_to_test=None, objfn_builders=None, optimizer=None, badfit_options=None, verbosity=2, name=None):

super().__init__(name)
Expand Down

0 comments on commit bb0529a

Please sign in to comment.