diff --git a/jupyter_notebooks/Tutorials/00-Protocols.ipynb b/jupyter_notebooks/Tutorials/00-Protocols.ipynb index 0efa74c5f..933473faf 100644 --- a/jupyter_notebooks/Tutorials/00-Protocols.ipynb +++ b/jupyter_notebooks/Tutorials/00-Protocols.ipynb @@ -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)." ] }, { @@ -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", @@ -332,7 +332,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/jupyter_notebooks/Tutorials/01-Essential-Objects.ipynb b/jupyter_notebooks/Tutorials/01-Essential-Objects.ipynb index d00d5ea52..8f4dfd58a 100644 --- a/jupyter_notebooks/Tutorials/01-Essential-Objects.ipynb +++ b/jupyter_notebooks/Tutorials/01-Essential-Objects.ipynb @@ -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:" ] }, { @@ -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!" ] }, @@ -411,7 +413,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/jupyter_notebooks/Tutorials/02-Using-Essential-Objects.ipynb b/jupyter_notebooks/Tutorials/02-Using-Essential-Objects.ipynb index dd2d18cfd..5e41d47c2 100644 --- a/jupyter_notebooks/Tutorials/02-Using-Essential-Objects.ipynb +++ b/jupyter_notebooks/Tutorials/02-Using-Essential-Objects.ipynb @@ -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." ] }, { diff --git a/jupyter_notebooks/Tutorials/objects/advanced/CustomOperator.ipynb b/jupyter_notebooks/Tutorials/objects/advanced/CustomOperator.ipynb index db5fec14e..ba5f7ac20 100644 --- a/jupyter_notebooks/Tutorials/objects/advanced/CustomOperator.ipynb +++ b/jupyter_notebooks/Tutorials/objects/advanced/CustomOperator.ipynb @@ -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", @@ -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)." ] }, { diff --git a/pygsti/data/datacomparator.py b/pygsti/data/datacomparator.py index 83b70481a..598d01915 100644 --- a/pygsti/data/datacomparator.py +++ b/pygsti/data/datacomparator.py @@ -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 " diff --git a/pygsti/protocols/gst.py b/pygsti/protocols/gst.py index f65da4fab..edf900e21 100644 --- a/pygsti/protocols/gst.py +++ b/pygsti/protocols/gst.py @@ -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: @@ -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 - - : 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 + - : any key in the `models_to_test` argument gaugeopt_suite : GSTGaugeOptSuite, optional Specifies which gauge optimizations to perform on each estimate. Can also @@ -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)