qiskit-ignis


Nameqiskit-ignis JSON
Version 0.7.1 PyPI version JSON
download
home_pagehttps://github.com/Qiskit/qiskit-ignis
SummaryQiskit tools for quantum information science
upload_time2022-05-18 13:13:03
maintainer
docs_urlNone
authorQiskit Development Team
requires_python>=3.6
licenseApache 2.0
keywords qiskit sdk quantum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Qiskit Ignis (_DEPRECATED_)

[![License](https://img.shields.io/github/license/Qiskit/qiskit-ignis.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)[![Build Status](https://img.shields.io/travis/com/Qiskit/qiskit-ignis/master.svg?style=popout-square)](https://travis-ci.com/Qiskit/qiskit-ignis)[![](https://img.shields.io/github/release/Qiskit/qiskit-ignis.svg?style=popout-square)](https://github.com/Qiskit/qiskit-ignis/releases)[![](https://img.shields.io/pypi/dm/qiskit-ignis.svg?style=popout-square)](https://pypi.org/project/qiskit-ignis/)

**_NOTE_** _As of the version 0.7.0 Qiskit Ignis is deprecated and has been
superseded by the
[Qiskit Experiments](https://github.com/Qiskit/qiskit-experiments) project.
Active development on the project has stopped and only compatibility fixes
and other critical bugfixes will be accepted until the project is officially
retired and archived._

**Qiskit** is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.

Qiskit is made up of elements that each work together to enable quantum computing. This element is **Ignis**, which provides tools for quantum hardware verification, noise characterization, and error correction.

## Migration Guide

As of version 0.7.0, Qiskit Ignis has been deprecated and some of its functionality 
was migrated into the `qiskit-experiments` package and into `qiskit-terra`.

* Ignis characterization module

  * This module was partly migrated to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments) and split into two different modules:
  `qiskit_experiments.library.calibration`
  `qiskit_experiments.library.characterization`
  * `AmpCal` is now replaced by `FineAmplitude`.
  * `ZZFitter` was not migrated yet.

* Ignis discriminator module

  * This module is in the process of migration to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments)

* Ignis mitigation module

  * The readout mitigator will be soon added to [`qiskit-terra`](https://github.com/Qiskit/qiskit-terra).
  * Experiments for generating the readout mitigators will be added to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments)
  * For use of mitigators with `qiskit.algorithms` and the [`QuantumInstance` class](https://qiskit.org/documentation/stubs/qiskit.utils.QuantumInstance.html?highlight=quantuminstance#qiskit.utils.QuantumInstance)
    this has been integrated into `qiskit-terra` directly with the `QuantumInstance`.

* Ignis verification module

  * Randomized benchmarking, Quantum Volume and State and Process Tomography were migrated to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments).
  * Migration of Gate-set tomography to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments) is in progress.
  * `topological_codes` will continue development under [NCCR-SPIN](https://github.com/NCCR-SPIN/topological_codes/blob/master/README.md), while the functionality is reintegrated into Qiskit. Some additional functionality can also be found in the offshoot project [qtcodes](https://github.com/yaleqc/qtcodes).
  * Currently the Accredition and Entanglement modules have not been migrated.  
The following table gives a more detailed breakdown that relates the function, as it existed in Ignis, 
to where it now lives after this move.

| Old | New | Library |
| :---: | :---: | :---: |
| qiskit.ignis.characterization.calibrations | qiskit_experiments.library.calibration | qiskit-experiments |
| qiskit.ignis.characterization.coherence | qiskit_experiments.library.characterization | qiskit-experiments |
| qiskit.ignis.mitigation | qiskit_terra.mitigation | qiskit-terra |
| qiskit.ignis.verification.quantum_volume | qiskit_experiments.library.quantum_volume | qiskit-experiments |
| qiskit.ignis.verification.randomized_benchmarking | qiskit_experiments.library.randomized_benchmarking | qiskit-experiments |
| qiskit.ignis.verification.tomography | qiskit_experiments.library.tomography | qiskit-experiments |

## Installation

We encourage installing Qiskit via the pip tool (a python package manager). The following command installs the core Qiskit components, including Ignis.

```bash
pip install qiskit
```

Pip will handle all dependencies automatically for us and you will always install the latest (and well-tested) version.

To install from source, follow the instructions in the [contribution guidelines](./CONTRIBUTING.md).

### Extra Requirements

Some functionality has extra optional requirements. If you're going to use any
visualization functions for fitters you'll need to install matplotlib. You
can do this with `pip install matplotlib` or when you install ignis with
`pip install qiskit-ignis[visualization]`. If you're going to use a cvx fitter
for running tomogography you'll need to install cvxpy. You can do this with
`pip install cvxpy` or when you install ignis with
`pip install qiskit-ignis[cvx]`. When performing expectation value measurement
error mitigation using the CTMP method performance can be improved using
just-in-time compiling if Numbda is installed. You can do this with
`pip install numba` or when you install ignis with
`pip install qiskit-ignis[jit]`. For using the discriminator classes in
`qiskit.ignis.measurement` scikit-learn needs to be installed. You can do this with
`pip install scikit-learn` or when you install ignis with
`pip install qiskit-ignis[iq]`. If you want to install all extra requirements
when you install ignis you can run `pip install qiskit-ignis[visualization,cvx,jit,iq]`.

## Creating your first quantum experiment with Qiskit Ignis
Now that you have Qiskit Ignis installed, you can start creating experiments, to reveal information about the device quality. Here is a basic example:

```
$ python
```

```python
# Import Qiskit classes
import qiskit
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister
from qiskit.providers.aer import noise # import AER noise model

# Measurement error mitigation functions
from qiskit.ignis.mitigation.measurement import (complete_meas_cal,
                                                 CompleteMeasFitter, 
                                                 MeasurementFilter)

# Generate a noise model for the qubits
noise_model = noise.NoiseModel()
for qi in range(5):
    read_err = noise.errors.readout_error.ReadoutError([[0.75, 0.25],[0.1, 0.9]])
    noise_model.add_readout_error(read_err, [qi])

# Generate the measurement calibration circuits
# for running measurement error mitigation
qr = QuantumRegister(5)
meas_cals, state_labels = complete_meas_cal(qubit_list=[2,3,4], qr=qr)

# Execute the calibration circuits
backend = qiskit.Aer.get_backend('qasm_simulator')
job = qiskit.execute(meas_cals, backend=backend, shots=1000, noise_model=noise_model)
cal_results = job.result()

# Make a calibration matrix
meas_fitter = CompleteMeasFitter(cal_results, state_labels)

# Make a 3Q GHZ state
cr = ClassicalRegister(3)
ghz = QuantumCircuit(qr, cr)
ghz.h(qr[2])
ghz.cx(qr[2], qr[3])
ghz.cx(qr[3], qr[4])
ghz.measure(qr[2],cr[0])
ghz.measure(qr[3],cr[1])
ghz.measure(qr[4],cr[2])

# Execute the GHZ circuit (with the same noise model)
job = qiskit.execute(ghz, backend=backend, shots=1000, noise_model=noise_model)
results = job.result()

# Results without mitigation
raw_counts = results.get_counts()
print("Results without mitigation:", raw_counts)

# Create a measurement filter from the calibration matrix
meas_filter = meas_fitter.filter
# Apply the filter to the raw counts to mitigate 
# the measurement errors
mitigated_counts = meas_filter.apply(raw_counts)
print("Results with mitigation:", {l:int(mitigated_counts[l]) for l in mitigated_counts})
```

```
Results without mitigation: {'000': 181, '001': 83, '010': 59, '011': 65, '100': 101, '101': 48, '110': 72, '111': 391}

Results with mitigation: {'000': 421, '001': 2, '011': 1, '100': 53, '110': 13, '111': 510}
```

## Contribution Guidelines

If you'd like to contribute to Qiskit Ignis, please take a look at our
[contribution guidelines](./CONTRIBUTING.md). This project adheres to Qiskit's [code of conduct](./CODE_OF_CONDUCT.md). By participating, you are expect to uphold to this code.

We use [GitHub issues](https://github.com/Qiskit/qiskit-ignis/issues) for tracking requests and bugs. Please use our [slack](https://qiskit.slack.com) for discussion and simple questions. To join our Slack community use the [link](https://join.slack.com/t/qiskit/shared_invite/enQtNDc2NjUzMjE4Mzc0LTMwZmE0YTM4ZThiNGJmODkzN2Y2NTNlMDIwYWNjYzA2ZmM1YTRlZGQ3OGM0NjcwMjZkZGE0MTA4MGQ1ZTVmYzk). For questions that are more suited for a forum we use the Qiskit tag in the [Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).

## Next Steps

Now you're set up and ready to check out some of the other examples from our
[Qiskit Tutorials](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/ignis) repository.

## Authors and Citation

Qiskit Ignis is the work of [many people](https://github.com/Qiskit/qiskit-ignis/graphs/contributors) who contribute
to the project at different levels. If you use Qiskit, please cite as per the included [BibTeX file](https://github.com/Qiskit/qiskit/blob/master/Qiskit.bib).

## License

[Apache License 2.0](LICENSE.txt)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Qiskit/qiskit-ignis",
    "name": "qiskit-ignis",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "qiskit sdk quantum",
    "author": "Qiskit Development Team",
    "author_email": "hello@qiskit.org",
    "download_url": "https://files.pythonhosted.org/packages/93/d7/a077a5d828037667f4449623ae6c982cac498ebc47e5975ed74c17c15772/qiskit-ignis-0.7.1.tar.gz",
    "platform": null,
    "description": "# Qiskit Ignis (_DEPRECATED_)\n\n[![License](https://img.shields.io/github/license/Qiskit/qiskit-ignis.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)[![Build Status](https://img.shields.io/travis/com/Qiskit/qiskit-ignis/master.svg?style=popout-square)](https://travis-ci.com/Qiskit/qiskit-ignis)[![](https://img.shields.io/github/release/Qiskit/qiskit-ignis.svg?style=popout-square)](https://github.com/Qiskit/qiskit-ignis/releases)[![](https://img.shields.io/pypi/dm/qiskit-ignis.svg?style=popout-square)](https://pypi.org/project/qiskit-ignis/)\n\n**_NOTE_** _As of the version 0.7.0 Qiskit Ignis is deprecated and has been\nsuperseded by the\n[Qiskit Experiments](https://github.com/Qiskit/qiskit-experiments) project.\nActive development on the project has stopped and only compatibility fixes\nand other critical bugfixes will be accepted until the project is officially\nretired and archived._\n\n**Qiskit** is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.\n\nQiskit is made up of elements that each work together to enable quantum computing. This element is **Ignis**, which provides tools for quantum hardware verification, noise characterization, and error correction.\n\n## Migration Guide\n\nAs of version 0.7.0, Qiskit Ignis has been deprecated and some of its functionality \nwas migrated into the `qiskit-experiments` package and into `qiskit-terra`.\n\n* Ignis characterization module\n\n  * This module was partly migrated to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments) and split into two different modules:\n  `qiskit_experiments.library.calibration`\n  `qiskit_experiments.library.characterization`\n  * `AmpCal` is now replaced by `FineAmplitude`.\n  * `ZZFitter` was not migrated yet.\n\n* Ignis discriminator module\n\n  * This module is in the process of migration to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments)\n\n* Ignis mitigation module\n\n  * The readout mitigator will be soon added to [`qiskit-terra`](https://github.com/Qiskit/qiskit-terra).\n  * Experiments for generating the readout mitigators will be added to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments)\n  * For use of mitigators with `qiskit.algorithms` and the [`QuantumInstance` class](https://qiskit.org/documentation/stubs/qiskit.utils.QuantumInstance.html?highlight=quantuminstance#qiskit.utils.QuantumInstance)\n    this has been integrated into `qiskit-terra` directly with the `QuantumInstance`.\n\n* Ignis verification module\n\n  * Randomized benchmarking, Quantum Volume and State and Process Tomography were migrated to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments).\n  * Migration of Gate-set tomography to [`qiskit-experiments`](https://github.com/Qiskit/qiskit-experiments) is in progress.\n  * `topological_codes` will continue development under [NCCR-SPIN](https://github.com/NCCR-SPIN/topological_codes/blob/master/README.md), while the functionality is reintegrated into Qiskit. Some additional functionality can also be found in the offshoot project [qtcodes](https://github.com/yaleqc/qtcodes).\n  * Currently the Accredition and Entanglement modules have not been migrated.  \nThe following table gives a more detailed breakdown that relates the function, as it existed in Ignis, \nto where it now lives after this move.\n\n| Old | New | Library |\n| :---: | :---: | :---: |\n| qiskit.ignis.characterization.calibrations | qiskit_experiments.library.calibration | qiskit-experiments |\n| qiskit.ignis.characterization.coherence | qiskit_experiments.library.characterization | qiskit-experiments |\n| qiskit.ignis.mitigation | qiskit_terra.mitigation | qiskit-terra |\n| qiskit.ignis.verification.quantum_volume | qiskit_experiments.library.quantum_volume | qiskit-experiments |\n| qiskit.ignis.verification.randomized_benchmarking | qiskit_experiments.library.randomized_benchmarking | qiskit-experiments |\n| qiskit.ignis.verification.tomography | qiskit_experiments.library.tomography | qiskit-experiments |\n\n## Installation\n\nWe encourage installing Qiskit via the pip tool (a python package manager). The following command installs the core Qiskit components, including Ignis.\n\n```bash\npip install qiskit\n```\n\nPip will handle all dependencies automatically for us and you will always install the latest (and well-tested) version.\n\nTo install from source, follow the instructions in the [contribution guidelines](./CONTRIBUTING.md).\n\n### Extra Requirements\n\nSome functionality has extra optional requirements. If you're going to use any\nvisualization functions for fitters you'll need to install matplotlib. You\ncan do this with `pip install matplotlib` or when you install ignis with\n`pip install qiskit-ignis[visualization]`. If you're going to use a cvx fitter\nfor running tomogography you'll need to install cvxpy. You can do this with\n`pip install cvxpy` or when you install ignis with\n`pip install qiskit-ignis[cvx]`. When performing expectation value measurement\nerror mitigation using the CTMP method performance can be improved using\njust-in-time compiling if Numbda is installed. You can do this with\n`pip install numba` or when you install ignis with\n`pip install qiskit-ignis[jit]`. For using the discriminator classes in\n`qiskit.ignis.measurement` scikit-learn needs to be installed. You can do this with\n`pip install scikit-learn` or when you install ignis with\n`pip install qiskit-ignis[iq]`. If you want to install all extra requirements\nwhen you install ignis you can run `pip install qiskit-ignis[visualization,cvx,jit,iq]`.\n\n## Creating your first quantum experiment with Qiskit Ignis\nNow that you have Qiskit Ignis installed, you can start creating experiments, to reveal information about the device quality. Here is a basic example:\n\n```\n$ python\n```\n\n```python\n# Import Qiskit classes\nimport qiskit\nfrom qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister\nfrom qiskit.providers.aer import noise # import AER noise model\n\n# Measurement error mitigation functions\nfrom qiskit.ignis.mitigation.measurement import (complete_meas_cal,\n                                                 CompleteMeasFitter, \n                                                 MeasurementFilter)\n\n# Generate a noise model for the qubits\nnoise_model = noise.NoiseModel()\nfor qi in range(5):\n    read_err = noise.errors.readout_error.ReadoutError([[0.75, 0.25],[0.1, 0.9]])\n    noise_model.add_readout_error(read_err, [qi])\n\n# Generate the measurement calibration circuits\n# for running measurement error mitigation\nqr = QuantumRegister(5)\nmeas_cals, state_labels = complete_meas_cal(qubit_list=[2,3,4], qr=qr)\n\n# Execute the calibration circuits\nbackend = qiskit.Aer.get_backend('qasm_simulator')\njob = qiskit.execute(meas_cals, backend=backend, shots=1000, noise_model=noise_model)\ncal_results = job.result()\n\n# Make a calibration matrix\nmeas_fitter = CompleteMeasFitter(cal_results, state_labels)\n\n# Make a 3Q GHZ state\ncr = ClassicalRegister(3)\nghz = QuantumCircuit(qr, cr)\nghz.h(qr[2])\nghz.cx(qr[2], qr[3])\nghz.cx(qr[3], qr[4])\nghz.measure(qr[2],cr[0])\nghz.measure(qr[3],cr[1])\nghz.measure(qr[4],cr[2])\n\n# Execute the GHZ circuit (with the same noise model)\njob = qiskit.execute(ghz, backend=backend, shots=1000, noise_model=noise_model)\nresults = job.result()\n\n# Results without mitigation\nraw_counts = results.get_counts()\nprint(\"Results without mitigation:\", raw_counts)\n\n# Create a measurement filter from the calibration matrix\nmeas_filter = meas_fitter.filter\n# Apply the filter to the raw counts to mitigate \n# the measurement errors\nmitigated_counts = meas_filter.apply(raw_counts)\nprint(\"Results with mitigation:\", {l:int(mitigated_counts[l]) for l in mitigated_counts})\n```\n\n```\nResults without mitigation: {'000': 181, '001': 83, '010': 59, '011': 65, '100': 101, '101': 48, '110': 72, '111': 391}\n\nResults with mitigation: {'000': 421, '001': 2, '011': 1, '100': 53, '110': 13, '111': 510}\n```\n\n## Contribution Guidelines\n\nIf you'd like to contribute to Qiskit Ignis, please take a look at our\n[contribution guidelines](./CONTRIBUTING.md). This project adheres to Qiskit's [code of conduct](./CODE_OF_CONDUCT.md). By participating, you are expect to uphold to this code.\n\nWe use [GitHub issues](https://github.com/Qiskit/qiskit-ignis/issues) for tracking requests and bugs. Please use our [slack](https://qiskit.slack.com) for discussion and simple questions. To join our Slack community use the [link](https://join.slack.com/t/qiskit/shared_invite/enQtNDc2NjUzMjE4Mzc0LTMwZmE0YTM4ZThiNGJmODkzN2Y2NTNlMDIwYWNjYzA2ZmM1YTRlZGQ3OGM0NjcwMjZkZGE0MTA4MGQ1ZTVmYzk). For questions that are more suited for a forum we use the Qiskit tag in the [Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).\n\n## Next Steps\n\nNow you're set up and ready to check out some of the other examples from our\n[Qiskit Tutorials](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/ignis) repository.\n\n## Authors and Citation\n\nQiskit Ignis is the work of [many people](https://github.com/Qiskit/qiskit-ignis/graphs/contributors) who contribute\nto the project at different levels. If you use Qiskit, please cite as per the included [BibTeX file](https://github.com/Qiskit/qiskit/blob/master/Qiskit.bib).\n\n## License\n\n[Apache License 2.0](LICENSE.txt)\n\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Qiskit tools for quantum information science",
    "version": "0.7.1",
    "project_urls": {
        "Homepage": "https://github.com/Qiskit/qiskit-ignis"
    },
    "split_keywords": [
        "qiskit",
        "sdk",
        "quantum"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "249199734111d2cd943afe9729de1795be283d4e5b2e92bfec26de2c255cd5dd",
                "md5": "c059c77982830ae7541440ec8412983e",
                "sha256": "b9d57f1241194361db492c37a63860fe76bfdcc0aa30759190e3166ed8ff8ef1"
            },
            "downloads": -1,
            "filename": "qiskit_ignis-0.7.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c059c77982830ae7541440ec8412983e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 198728,
            "upload_time": "2022-05-18T13:13:01",
            "upload_time_iso_8601": "2022-05-18T13:13:01.368345Z",
            "url": "https://files.pythonhosted.org/packages/24/91/99734111d2cd943afe9729de1795be283d4e5b2e92bfec26de2c255cd5dd/qiskit_ignis-0.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93d7a077a5d828037667f4449623ae6c982cac498ebc47e5975ed74c17c15772",
                "md5": "55a8e6a97f1c62d1f4dcb82c880fba7a",
                "sha256": "71efb17933717c0b8161a291ebd4f8d4fe8d7dfd1fdc66fa23a0b6d14fd10cf3"
            },
            "downloads": -1,
            "filename": "qiskit-ignis-0.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "55a8e6a97f1c62d1f4dcb82c880fba7a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 144667,
            "upload_time": "2022-05-18T13:13:03",
            "upload_time_iso_8601": "2022-05-18T13:13:03.569362Z",
            "url": "https://files.pythonhosted.org/packages/93/d7/a077a5d828037667f4449623ae6c982cac498ebc47e5975ed74c17c15772/qiskit-ignis-0.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-18 13:13:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Qiskit",
    "github_project": "qiskit-ignis",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "qiskit-ignis"
}
        
Elapsed time: 0.28686s