Skip to content

qiskit-community/qutrit-calibration

Repository files navigation

Qutrit Calibration

License

A qutrit experiment extension for Qiskit Experiments. This package allows for straightforward calibration of single qutrit gates.

Note:

A word of caution: this package is an alpha release and subject to breaking API changes without much notice.

Once installed it can imported using

import qiskit_qutrit_calibration

Installation

This package can be in one of three ways:

  1. Installed via pip as
pip install qiskit-qutrit-calibration
  1. Installed from the downloaded repository using pip as
cd qiskit-qutrit-calibration
pip install .
  1. Installed directly using the github url
pip install git+https://github.com/qiskit-community/qutrit-calibration

Usage

This package allows users to spin up their own calibration experiments for single qutrit gates SX12, X12, Sy12, Y12, and RZ12. The experiments to tune up these gates include:

  • RoughEFFrequencyCal
  • RoughEFAmplitudeCal
  • NarrowBandSpectroscopyCal
  • RoughEFXDragCal
  • FineEFXAmplitudeCal

Simply create a new QutritCalibrations object using

cals = QutritCalibrations.from_backend(backend)

Then execute an experiment using the instantiated QutritCalibrations, a Tuple of qubit indices, and backend to run on. For example,

from qiskit_qutrit_calibration import library

exp = library.RoughEFFrequencyCal( (qubit_index), calibrations=cals, backend=backend )

Development Scripts

This package includes several pre-configured tox scripts for automating development of your package. These commands can be run from the command line

cd qutrit-calibration
tox -e <command>
Command Description
``py` Run unit tests for the package using stestr
black Auto-format your package files using Black
lint Run PyLint on your package to check code formatting. Note that linting will fail if running black would modify any files
docs Generate documentation for the package using Sphinx

If you do not already have the tox command installed, install it by running

pip install tox

Testing Your Package

This package is configured with stestr and tox scripts to run unit tests added to the qutrit-calibration/test folder.

These can be run directly via stestr using the command

cd qutrit-calibration
stestr run

Or using to tox script tox -e py to install all dependencies and run the tests in an isolated virtual environment.

To add tests to your package you must including them in a files prefixed as test_*.py in the test/ folder or a subfolder. Tests should be written using the unittest framework to make a test class containing each test as a separate method prefixed as test_*.

For example:

class BasicTests(unittest.TestCase):
    """Some basic tests for Qiskit Qutrit Calibration"""

    def test_something(self):
        """A basic test of something"""
        # Write some code here
        some_value = ...
        target = ...
        self.assertTrue(some_value, target)

Documenting Your Package

You can add documentation or tutorials to your package by including it in the qutrit-calibration/docs folder and building it locally using the tox -edocs command.

Documentation is build using Sphinx. By default will include any API documentation added to your packages main __init__.py file.

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages