Skip to content

Commit

Permalink
Expand calibrations on client side (#1271)
Browse files Browse the repository at this point in the history
* Expand calibrations on the client side

This introduces a few things:

  * QPUCompiler#_calibrations is a calibrations cache

  * QPUCompiler#get_calibrations (formerly
  QPUCompiler#get_quilt_calibrations) makes an API call to pull the
  latest calibrations from the translation service. It cares not for
  any cache.

  * QPUCompiler#refresh_calibrations grabs the latest calibrations and
  caches them

  * QPUCompiler#calibrations is a property that provides access to the
  cache if it exists, or populates the cache if it doesn't exist.

  * QPUCompiler#expand_calibrations takes a program, and returns a
  program where all calibrations are expanded. Calibrations defined in
  the input program take preference (hopefully) over those in the
  aforementioned cache.

* Store the calibrations Program rather than calibrations list

get_quilt_calibrations() returns more than just the calibrations - it
returns a bunch of frame defintions and waveform definitions. Bydoing

    self._calibrations = get_quilt_calibrations().calibrations

we are throwing away the frames/waveforms.

* fix style

* refactor calibrations -> calibration_program

and similar refactors

* update notebooks

* format
  • Loading branch information
notmgsk committed Nov 25, 2020
1 parent eac8942 commit ed7633d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pyquil/api/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,22 @@ def calibration_program(self) -> Program:


@_record_call
def get_quilt_calibrations(self) -> Program:
def get_calibration_program(self) -> Program:
"""
See ``QPUCompiler.get_quilt_calibrations()``.
See ``QPUCompiler.get_calibration_program()``.
Note: this currently provides an empty ``Program`` since the QVM does not support Quilt.
Note: this currently provides an empty Program because the QVM does not support Quilt.
"""
return Program()

@_record_call
def refresh_calibration_program(self) -> None:
pass

@property
def calibration_program(self) -> Program:
return Program()


@dataclass
class HTTPCompilerClient:
Expand Down

0 comments on commit ed7633d

Please sign in to comment.