indirect-zne

Quantum error mitigation using Zero Noise Extrapolation (ZNE) in indirect-control system

https://github.com/arijit-ship/indirect-zne

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.0%) to scientific vocabulary

Keywords

error-mitigation quantum-computing qulacs zero-noise-extrapolation
Last synced: 6 months ago · JSON representation ·

Repository

Quantum error mitigation using Zero Noise Extrapolation (ZNE) in indirect-control system

Basic Info
  • Host: GitHub
  • Owner: arijit-ship
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 19.8 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 2
Topics
error-mitigation quantum-computing qulacs zero-noise-extrapolation
Created almost 2 years ago · Last pushed 8 months ago
Metadata Files
Readme Citation

README.md

Indirect-Control VQE and ZNE Error Mitigation

Installation

  • Python Version: 3.11
  • To install dependencies, run:
    bash pip install -r requirements.txt

Usage

To run the program, use:
bash python3 main.py <config.yml>

Configuration Details

The program uses a YAML configuration file to define its parameters. Below is a detailed description of the configuration categories and their parameters:

| Section | Key | Type | Description | |-------------------------------------|-----------------------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Run Configuration | run | String | Defines the algorithm to run. Options: 'vqe', 'redundant', 'zne'. | | System Configuration | nqubits | Integer | Specifies the number of qubits in the quantum system. | | | state | String | Defines the state representation. Options: 'dmatrix' (density matrix) or 'statevector'. | | Observable (Target Hamiltonian) | def | String | Defines the type of Hamiltonian. Options: 'custom', 'ising', 'heisenberg'. Warning: Coefficients are overwritten based on the selected type. For 'ising', cn values are set to [0.5], bn values are set to [1], and r is set to 1. For 'heisenberg', only cn is used. | | | coefficients | Object | Contains coefficients for the Hamiltonian terms: | | | | cn | List of Floats | Defines the coefficients for the interaction term. Example: [0.5, 0.5, 0.5]. | | | | bn | List of Floats | Defines the coefficients for the coupling terms. Example: [1.0, 1.0, 1.0, 1.0]. | | | | r | Float | Defines the coefficient for the scaling term. Example: 1. | | Output Configuration | file_name_prefix | String | Specifies the prefix for the output file name. | | | draw | Object | Configures drawing options for output files: | | | | status | Boolean | If True, enables figure drawing. Example: False. | | | | fig_dpi | Integer | Specifies the resolution of the output figure. Example: 100. | | | | type | String | Specifies the type of output file. Example: "png". | | VQE Configuration | iteration | Integer | Specifies the number of iterations for the VQE algorithm. | | | optimization | Object | Configures optimization settings: | | | | status | Boolean | If True, enables optimization. Example: True. | | | | algorithm | String | Specifies the optimization algorithm. Options: "SLSQP". | | | | constraint | Boolean | If True, enables constraint optimization. Example: False. | | | ansatz | Object | Configures the ansatz circuit: | | | | type | String | Defines the type of the ansatz. Options: 'custom', 'xy-iss', 'ising', 'heisenberg'. Warning: Must be 'xy-iss' for ZNE redundant circuits. | | | | layer | Integer | Specifies the number of layers for the ansatz. Example: 10. | | | | gateset | Integer | Specifies the gate set used. Example: 1. | | | | ugate | Object | Defines the U gate settings: | | | | | coefficients | Object | Contains coefficients for the U gate: | | | | | cn | List of Floats | Defines the coefficients for the interaction terms in the U gate. Example: [0.5, 0.5, 0.5]. | | | | | bn | List of Floats | Defines the coefficients for the coupling terms in the U gate. Example: [0, 0, 0, 0]. | | | | | r | Float | Defines the coefficient for the scaling term in the U gate. Example: 0. | | | | | time | Object | Defines the time range for the gate: | | | | | min | Float | Minimum time. Example: 0.0. | | | | | max | Float | Maximum time. Example: 10.0. | | | | noise | Object | Defines noise parameters: | | | | | status | Boolean | If True, enables noise. Example: True. | | | | | value | List of Floats | Specifies noise probabilities for different gate types in the order [r, cz, u, y]. Example: [0.001, 0.01, 0.001, 0.01]. | | | init_param | String | Defines the initialization method for parameters. Options: 'random', etc. Example: "random". | | Redundant Circuit Configuration | identity_factors | List of Lists | Specifies the identity scaling factors for gates. Example: [[1, 0, 0, 1], [2, 3, 2, 1], ...]. | | | Warning | String | Warning: Identity scaling for the U gate is supported only if the ansatz type is 'xy-iss'. For other types, the identity scaling factor for the U gate must be set to 0. | | Zero Noise Extrapolation (ZNE) | method | String | Defines the method for zero-noise extrapolation. Options: 'linear', 'polynomial', 'richardson', 'richardson-mul'. | | | degree | Integer | Sets the degree for polynomial or Richardson methods. Used for regression. | | | sampling | String | Specifies the sampling method for extrapolation. Options: 'default', 'default-N', 'random-N', where N is an integer. | | | data_points | List of Lists | Provides the data points for extrapolation. Each entry contains several values, such as time and noise levels. Example: [[12, 1, 0, 3, -3.3480294367352315], [20, 7, 10, 3, -0.05316450776222178], ...]. |

Warnings and Important Notes

  1. Observable (Target Hamiltonian) Coefficients Overwritten:

    • For the ising Hamiltonian (observable.def: "ising"), the coefficients are automatically overwritten as follows:
      • cn: [0.5]
      • bn: [1.0]
      • r: 1
    • For the heisenberg Hamiltonian (observable.def: "heisenberg"), only the cn coefficient is used, and bn and r are ignored.
  2. Ansatz Type for Zero Noise Extrapolation (ZNE):

    • When using Zero Noise Extrapolation (ZNE) with redundant circuits, the ansatz type must be set to 'xy-iss' (vqe.ansatz.type: "xy-iss"). This is required for identity-scaling the circuit gates (U, Y, and CZ).
    • Warning: The identity-scaling for the U gate is only supported if the ansatz type is 'xy_model-xz-z'. For other ansatz types, the identity scaling for the U gate must be set to 0.
  3. VQE Ansatz Coefficients Overwritten:

    • When using the VQE algorithm with certain ansatz types ('xy-iss'), the coefficients are automatically overwritten as follows:
      • cn: [0.5]
      • bn: [0]
      • r: 0
    • For ansatz types such as 'ising' or 'heisenberg', the coefficients are predefined according to the selected type.
  4. Initialization of Parameters:

    • The initial parameters for the ansatz are set to random by default (vqe.ansatz.init_param: "random"). If you need to modify the initialization method, ensure to update this value accordingly.
  5. Sampling Method for Zero Noise Extrapolation:

    • The sampling method should be selected appropriately:
      • 'default' - All points are sampled.
      • 'default-N' - The first N points are sampled.
      • 'random-N' - N points are sampled randomly.
    • Ensure that the method aligns with the desired sampling strategy for extrapolation.

Testing

For testing, use pytest.
To run the tests, execute:
bash pytest test/.

Linting and Formatting

  • Use flake8 for linting.
  • Use black and isort for formatting the code.
    ```bash # Run linting flake8 .

# Run formatting black . isort . ```

Owner

  • Name: Arijit Das
  • Login: arijit-ship
  • Kind: user

Citation (CITATION. cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Das"
  given-names: "Arijit"
  orcid: ""
- family-names: "Owari"
  given-names: "Masaki"
  orcid: ""
title: "Indirect-control VQE and ZNE"
version: 
doi: 
date-released: 2023
url: "https://github.com/arijit-ship/indirect-zne"

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 3
  • Push event: 107
  • Pull request event: 9
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 3
  • Push event: 107
  • Pull request event: 9
  • Create event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.33
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.33
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • arijit-ship (5)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
requirements.txt pypi
  • Pillow ==9.5.0
  • PubChemPy ==1.0.4
  • PyJWT ==2.8.0
  • PyQt5 ==5.15.10
  • PyQt5-Qt5 ==5.15.2
  • PyQt5-sip ==12.13.0
  • PyYAML ==6.0.1
  • Pygments ==2.17.2
  • annotated-types ==0.7.0
  • astroid ==3.2.2
  • asttokens ==2.4.1
  • autopep8 ==2.1.2
  • beautifulsoup4 ==4.12.3
  • black ==24.4.2
  • certifi ==2024.2.2
  • cffi ==1.16.0
  • charset-normalizer ==3.3.2
  • cirq-core ==1.3.0
  • click ==8.1.7
  • comm ==0.2.1
  • contourpy ==1.2.0
  • cryptography ==42.0.5
  • cycler ==0.12.1
  • dataclasses-json ==0.5.14
  • debugpy ==1.8.1
  • decorator ==5.1.1
  • deprecation ==2.1.0
  • dill ==0.3.8
  • duet ==0.2.9
  • exceptiongroup ==1.2.0
  • executing ==2.0.1
  • flake8 ==7.0.0
  • fonttools ==4.49.0
  • google ==3.0.0
  • h5py ==3.10.0
  • ibm-cloud-sdk-core ==3.19.2
  • ibm-platform-services ==0.51.2
  • idna ==3.6
  • iniconfig ==2.0.0
  • ipykernel ==6.29.3
  • ipympl ==0.9.3
  • ipython ==8.22.2
  • ipython-genutils ==0.2.0
  • ipywidgets ==8.1.2
  • isort ==5.13.2
  • jedi ==0.19.1
  • joblib ==1.3.2
  • jupyter_client ==8.6.0
  • jupyter_core ==5.7.1
  • jupyterlab_widgets ==3.0.10
  • kiwisolver ==1.4.5
  • marshmallow ==3.21.1
  • matplotlib ==3.8.3
  • matplotlib-inline ==0.1.6
  • mccabe ==0.7.0
  • mpmath ==1.3.0
  • mypy-extensions ==1.0.0
  • nest-asyncio ==1.6.0
  • networkx ==3.2.1
  • numpy ==1.26.4
  • openfermion ==1.6.1
  • openfermionpyscf ==0.5
  • packaging ==23.2
  • pandas ==2.2.1
  • parso ==0.8.3
  • pathspec ==0.12.1
  • pbr ==6.0.0
  • pexpect ==4.9.0
  • platformdirs ==4.2.0
  • pluggy ==1.4.0
  • prompt-toolkit ==3.0.43
  • psutil ==5.9.8
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pycodestyle ==2.11.1
  • pycparser ==2.21
  • pydantic ==2.7.1
  • pydantic_core ==2.18.2
  • pyflakes ==3.2.0
  • pylatexenc ==2.10
  • pylint ==3.2.2
  • pyparsing ==3.1.1
  • pyscf ==2.5.0
  • pyspnego ==0.10.2
  • pytest ==8.0.2
  • python-dateutil ==2.9.0.post0
  • pytz ==2024.1
  • pyzmq ==25.1.2
  • qiskit ==1.1.0
  • qiskit-ibm-runtime ==0.23.0
  • qulacs ==0.6.3
  • qulacsvis ==0.7.3
  • requests ==2.31.0
  • requests-ntlm ==1.2.0
  • rustworkx ==0.14.1
  • scikit-learn ==1.4.2
  • scipy ==1.12.0
  • six ==1.16.0
  • sortedcontainers ==2.4.0
  • soupsieve ==2.5
  • stack-data ==0.6.3
  • stevedore ==5.2.0
  • symengine ==0.11.0
  • sympy ==1.12
  • temp ==2020.7.2
  • threadpoolctl ==3.5.0
  • tk ==0.1.0
  • tomli ==2.0.1
  • tomlkit ==0.12.5
  • tornado ==6.4
  • tqdm ==4.66.2
  • traitlets ==5.14.1
  • typing-inspect ==0.9.0
  • typing_extensions ==4.10.0
  • tzdata ==2024.1
  • urllib3 ==2.2.1
  • wcwidth ==0.2.13
  • websocket-client ==1.7.0
  • widgetsnbextension ==4.0.10
  • yml ==0.0.1