Skip to content

Conversation

@eggerdj
Copy link
Contributor

@eggerdj eggerdj commented Jun 17, 2021

Summary

This PR implements a method to help users setup a Calibrations instance.

Details and comments

Setting up Calibrations instances when no previously saved data is available can be tedious. This PR is the start of a set of functions that can help users set-up a calibrations instances by populating it with typical pulse schedules and some parameter values. In this PR we implement a function to setup xp, xm, x90p, x90m, y90p, and y90m single-qubit rotations implemented with Drag pulses in a calibrations for transmon qubits. This library of functions will be extended in the future.

@nkanazawa1989
Copy link
Collaborator

Overall this looks good and the calibration tutorial should be updated with this functionality. However this design should be more extendable.

  1. Create basis_gate_library

Here you can define template generator against each basis gate. In current implementation X and SX gate template are generated at the same time, however, we might not want to calibrate X gate since this is not necessary for the universal gate set. If this library can initialize template per basis gate, we can design backend object more flexibly by combining arbitrary set of gate from library. We should be able to define library for different processor architectures, i.e. library="superconducting-fixed-freq-fixed-coupling" or library="superconducting-fixed-freq-tunable-coupling" etc...

  1. Add basis gates to backend calibration constructor

This allows end-users to easily initialize template pulses. For example,

cal = BackendCalibrations(
    backend, 
    basis_gates=["x", "sx"], 
    library="ibm-quantum-default"  # name TBD
)

Then BackendCalibrations accesses to the ibm-quantum-default library (I think for single qubit gate schedule there will be no much difference among superconducting architectures, this is mainly for multiqubit gate) and automatically collect template generators based on given basis gates. In the first release we can hardcord some assumptions, i.e. parameter link between gate duration and sigma for all single qubit under the name of ibm-quantum-default library. This part could be more flexible by directly injecting callable or dictionary that maps name-generator. We might also want define some rule (e.g. use same sigma for gate x, y, z... etc) more flexibly. But these are kind of overkill for now. We can continue to update this with user feedback.

The entire workflow eventually would be

define basis_gates
define architecture
define backend

calibration = BackendCalibration(backend, basis_gates, architecture)

define workflow  # description of connection of experiment
result = workflow.run(calibration, logger)

calibrated_backend = calibration.export()  # basis_gates is already know

import qiskit_other_module

qiskit_other_module.some_experiment(backend=calibrated_backend , **config)

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Couple of minor comments but overall this is almost good to go.

@nkanazawa1989
Copy link
Collaborator

one more comment: perhaps you can add sy and y to the library. we may need these gate depending on the mixer skew of hardware.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel. This is really close. Alternative option to set library would be

            cals = BackendCalibrations(
                    backend,
                    basis_gates=["x", "sx"],
                    library=FixedFrequencyTransmon(duration=320),
                )

i.e. give the library instance instead of class + init args separately. I don't see strong motivation to separate them for current implementation.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I all agree with @wshanks 's suggestions. However it looks good to me other than this. Please feel free to go forward with the suggestions.


__default_values__ = {"duration": 160, "amp": 0.5, "β": 0.0}

def __init__(self, default_values: Optional[Dict] = None, use_drag: bool = True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps you can explicitly write duration_default, amp_default, beta_default here.

Copy link
Collaborator

@wshanks wshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one little thing to change.

@eggerdj eggerdj merged commit 051c536 into qiskit-community:main Jul 23, 2021
@eggerdj eggerdj deleted the calibrations_setup branch July 23, 2021 06:19
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
* * Implemented method to setup single-qubit calibrations.

* * Refactored cals setup to library style.

* * Fix sigma in test.

* Update qiskit_experiments/calibration_management/basis_gate_library.py

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

* * Made library options kwargs.

* * Added error raising.

* * Added basis gates property.

* * Renamed transmon library.

* * Docs.

* * Added better Drag optionality.

* * Added y and sy gates to library.

* * Add check to make sure we do not add default values for gates that were not selected.

* Update qiskit_experiments/calibration_management/basis_gate_library.py

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

* * Docs.

* * Update the way the library is passed to BackendCalibrations.

* * Lint.

* * Added option to link parameters.

* * Partial generation of basis gates.

* * Added test.

* * Fixed test issue and added in operator.

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
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.

3 participants