Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace backend.calibration & backend.parameters with backend.properties #870

Merged
merged 12 commits into from
Sep 21, 2018

Conversation

ajavadia
Copy link
Member

@ajavadia ajavadia commented Sep 7, 2018

Fix #778

Summary

One major inconsistency between the defined spec/schemas and the current qiskit API is the methods backend.calibration and backend.parameters. The data returned from these should just be combined and returned via backend.properties.
The API doesn't have this endpoint yet, so this is a temporary hack in Qiskit to make the API consistent for 0.6 Should fix (along with a bunch of other FIXMEs) when the API finally gets updated.

The PR also does the following cleanups:

  • Fixes a bug in the status schema that did not report backend name and version, like other backend calls.
  • Fully remove some deprecated stuff (and messages) from _register.py and qasm_simulator_py

Details and comments

@ajavadia
Copy link
Member Author

@dcmckayibm This is what i get from the merge of calibration and parameters. Can you check if this is all the information that should be contained in properties?

{'backend': 'ibmqx4',
 'fridge_parameters': {'Temperature': {'date': '-', 'unit': '-', 'value': []},
  'cooldownDate': '2017-09-07'},
 'last_update_date': '2018-09-11T10:01:05.000Z',
 'multi_qubit_gates': [{'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.025416565897270732},
   'name': 'CX1_0',
   'qubits': [1, 0],
   'type': 'CX'},
  {'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.025959274240280383},
   'name': 'CX2_0',
   'qubits': [2, 0],
   'type': 'CX'},
  {'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.025823578091021426},
   'name': 'CX2_1',
   'qubits': [2, 1],
   'type': 'CX'},
  {'gateError': {'date': '2018-09-11T10:01:05Z', 'value': 0.0752538677586006},
   'name': 'CX3_2',
   'qubits': [3, 2],
   'type': 'CX'},
  {'gateError': {'date': '2018-09-11T10:01:05Z', 'value': 0.04412209362278141},
   'name': 'CX3_4',
   'qubits': [3, 4],
   'type': 'CX'},
  {'gateError': {'date': '2018-09-11T10:01:05Z', 'value': 0.05384498081562386},
   'name': 'CX4_2',
   'qubits': [4, 2],
   'type': 'CX'}],
 'qubits': [{'T1': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 44},
   'T2': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 52.9},
   'buffer': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 10},
   'frequency': {'date': '2018-09-11T10:01:05Z',
    'unit': 'GHz',
    'value': 5.24983},
   'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.0006867731322012238},
   'gateTime': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 60},
   'name': 'Q0',
   'readoutError': {'date': '2018-09-11T10:01:05Z', 'value': 0.069}},
  {'T1': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 65.9},
   'T2': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 28.9},
   'buffer': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 10},
   'frequency': {'date': '2018-09-11T10:01:05Z',
    'unit': 'GHz',
    'value': 5.29578},
   'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.002662115274625232},
   'gateTime': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 60},
   'name': 'Q1',
   'readoutError': {'date': '2018-09-11T10:01:05Z', 'value': 0.057}},
  {'T1': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 43.2},
   'T2': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 38.7},
   'buffer': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 10},
   'frequency': {'date': '2018-09-11T10:01:05Z',
    'unit': 'GHz',
    'value': 5.35322},
   'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.0009443532335046134},
   'gateTime': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 60},
   'name': 'Q2',
   'readoutError': {'date': '2018-09-11T10:01:05Z', 'value': 0.028}},
  {'T1': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 48.5},
   'T2': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 20.3},
   'buffer': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 10},
   'frequency': {'date': '2018-09-11T10:01:05Z',
    'unit': 'GHz',
    'value': 5.43499},
   'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.001803112096824766},
   'gateTime': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 60},
   'name': 'Q3',
   'readoutError': {'date': '2018-09-11T10:01:05Z', 'value': 0.033}},
  {'T1': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 53.1},
   'T2': {'date': '2018-09-11T10:01:05Z', 'unit': 'µs', 'value': 12.1},
   'buffer': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 10},
   'frequency': {'date': '2018-09-11T10:01:05Z',
    'unit': 'GHz',
    'value': 5.17581},
   'gateError': {'date': '2018-09-11T10:01:05Z',
    'value': 0.0013737021608475342},
   'gateTime': {'date': '2018-09-11T10:01:05Z', 'unit': 'ns', 'value': 60},
   'name': 'Q4',
   'readoutError': {'date': '2018-09-11T10:01:05Z', 'value': 0.157}}]}

@ajavadia ajavadia requested a review from dcmckayibm September 13, 2018 01:36
@jaygambetta
Copy link
Member

@ajavadia lets not worry about the elements until we update the API. This looks good to me

jaygambetta
jaygambetta previously approved these changes Sep 18, 2018
@jaygambetta
Copy link
Member

actually why not use merged_dict = {**base_dict, **other_dict} instead of making function.

@ajavadia
Copy link
Member Author

@jaygambetta the merging is slightly more complicated because the arrays within the dicts need to be combined as well. For example, the key 'qubits' gives a list of properties for each qubit, and the elements of that list are dictionaries themselves: 'T1', 'T2', 'Frequency', 'GateError', 'GateTime', 'name'). Some of these come from calibrations, some from parameters.

The function I've written handles recursive merging for cases like this (dict inside list inside dict).

I rebased against master.

@ajavadia ajavadia force-pushed the feature/backend-properties branch 3 times, most recently from 8f65fb5 to b9f10d2 Compare September 20, 2018 13:29
diego-plan9
diego-plan9 previously approved these changes Sep 20, 2018
Copy link
Member

@diego-plan9 diego-plan9 left a comment

Choose a reason for hiding this comment

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

Thanks @ajavadia - and specially for taking the time to catch and fully deprecate a number of things in the process 🎉

@jaygambetta
Copy link
Member

This looks good.

@jaygambetta jaygambetta merged commit d205048 into Qiskit:master Sep 21, 2018
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
Replace backend.calibration & backend.parameters with backend.properties
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.

Create backend.properties method in API and Terra
3 participants