Skip to content

Conversation

@gadial
Copy link
Contributor

@gadial gadial commented May 19, 2021

Summary

This PR imports the rb_utils file from qiskit ignis, in the following version: https://github.com/Qiskit/qiskit-ignis/blob/81955597ebabe1870088e4adc606f7ad2d71ffa8/qiskit/ignis/verification/randomized_benchmarking/rb_utils.py

Details and comments

The rb_utils file contains the auxiliary methods required for conversion between EPC (error per Clifford) obtained directly from RB, and EPG (error per gate in the gateset basis), the goal of RB.

When importing the file, two major changes were done:

  1. Deprecated methods and parts of the code were removed
  2. The gateset was changed from [u1, u2, u3, cx] to [rz, x, sx, cx]

@ShellyGarion ShellyGarion self-requested a review May 19, 2021 10:11
* * First draft of SVD node.
* Added tests.
* Added train method to DataAction.

* * Added node and data processor training functionality.

* * Fixed bug in _call_internal.
* Added SVD training test.
* Added required dimension to SVD.

* * Added run-time options to data processor
* Added error propagation mechanisme to the data processor.
* Added optional outcome to Probability.
* Added AverageIDData Node.
* Added averaging and SVD test.

* * Added error propagation for SVD node and tests.
* Black and lint.

* * Added call to super().setUp()

* * Removed redundent setUp

* * Made the averaging node independent of IQData.

* * Docstring.

* * Black

* * Lint

* * Black.

* * Fix docstring.

* Update qiskit_experiments/data_processing/data_processor.py

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>

* * Made means a function to improve readability.

* * Removed RealAvg and ImagAvg.

* * Added TrainableDataAction as a subclass of DataAction.

* * Removed _required_dimension.

* * Removed **options from data processing.

* * Used the property

* * Removed raises in SVD.

* * Made scale default to 1.0

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
@ShellyGarion
Copy link
Contributor

  1. How these functions are related to the RBAnalysis class? How should the outputs be stored in the ResultsDB?
  2. I would suggest to make a class for all these function. The function gates_per_clifford can be an internal function _gates_per_clifford, since it's a helper function, while the other functions are externalized.
  3. It would be good to add these functions to the RB tutorial notebook (and compare their outcome with the backend gate errors)
  4. How should the coherence_limit function interact with the other experiments, like the T1 experiment?
  5. The basis gates [rz, sx, x, cx] are hard-coded in the functions. Shouldn't they be only a default option?
    Do we want the user to be able to define other basis gates (and then also provide the ratios of their errors if needed)?

merav-aharoni and others added 13 commits May 24, 2021 14:36
* Initial class for T2StarExperiment

* Initial version of Ramsey experiment

* changed names Ramsey to t2star

* Wrote test for t2star

* Continued to develop the test for t2star

* Fixed bug - missing enumerate in loop

* Cleaned up documentation and add a function _format_plot

* Added conversion of units to SI

* Added tests for all units (except dt))

* Support for dt unit

* Moved function _t2star_default_params outside the function _run_analysis. Added the function _fit_quality

* Cleaning up and added hints for parameters

* black

* put matplotlib as optional

* Removed files that were included  by mistake

* lint fixes

* Black fixes

* more lint

* Removed blank line and moved pylint disable

* Fixed hints, variable names

* Documentation and other small fixes from review

* Removed self._p0 and more cleaning

* Cleaning up, comments from review

* Moved comparison of p0 and freq from _fit_quality to an assert in the test

* Fixed some confusion between  measurement of + and measurement of 1. Increased delta

* Fixed confusion regarding if measuring + or measuring 1

* Removed unnecessary definition of prob1

* Use plotting instead of matplotlib directly

* black

* pylint

* increased delta in tests
* Fix bug in multi_curve_fit for kwarg params

* Add error message to failed analysis

If analysis fails include the exception raised in the returned result so it can be viewed.

* Update interleaved-rb analysis

* Fit directly to alpha * alpha_c in interleaved model
* Use kwarg format for curve fitting
* plot raw data on scatter plot
* Change color of interleaved fit curve in figure and add legend.

* update notebook

* unused variable

* Fix alpha_c initial guess

* Fix equation

* Update plot colors

* update notebook and systematic error

Change way systematic error is reported in result to be "EPC_systematic_err" and "EPC_systematic_bounds"
* Do not use QuantumCircuit.copy to avoid overheads

* Using precomputed clifford data for 1 and 2 qubits

* Improvements to the Clifford-generation optimization

* Testing an alternative way to generate the inverse circuit

* Testing clifford generation from circuit instead of saving in a file

* Removed storing cliffords in json, added LRU cache for circuit generation

* Linting and doc

* Linting after merge

* Adding W gate synthesis to the clifford utils
* Create test_rb.py

* Update test_rb.py

* Update test_rb.py

* Update test_rb.py

* Update test_rb.py

* Added Test to validate the circuit data

Changed names of some variables to represent better their content, added return var for experiment results.

Added Test to validate the circuit data with the experiment attribute.

* Lint fixed

* Added test for transpiled circuit

Few things were changed:

1. There is a function for each test experiment configuration.

2. Added transpiled circuit check using process_fidelity from qiskit.quantum_info.operators.measures

3. Changed the np.allclose to matrix_equal function to be invariant for global phase.

* Update test_rb.py

* Update test_rb.py

* Black and lint

* uncommented test

* Changes in experiment attributes

Changed some experiment attributes.
Added comment why every configuration that return by _exp_data_properties() should raise an exception.

* Added ddt decorator and use it to decrease the number of functions

Added decorator to make one function that test for different data  (In this case: number of qubits)

* Deleted the test for the transpiled circuit

Deleted the test for the transpiled circuit since the function doesn't exist anymore

* Ran Black on the code

* The test_rb.py passed lint (local)

* Update __init__.py

* Fixed the test for metadata and run experiment

* Run Black

* Fixed lint

* Deleted - Test for input error hadling

Two function that were for the input test were deleted.
No need to import QiskitError
* * Added a seed for the T2Star experiment.

* * Switched to np.random.default_rng(0).
* Adding tests for interleaved RB

* Small fixes in the test file

* Linting

* Removing unused import
@gadial
Copy link
Contributor Author

gadial commented Jun 10, 2021

Replaced by a more extensive PR, #86

@gadial gadial closed this Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants