rigetti / rpcq

The RPC framework and message specification for @rigetti Quantum Cloud Services.
Apache License 2.0
75 stars 29 forks source link

Add SetScale instruction #130

Closed braised-babbage closed 4 years ago

braised-babbage commented 4 years ago

Although RPCQ Pulse messages have a scale field, it is at times convenient to apply a scale factor independent of any specific pulse. To support this I have made two changes:

The intended semantics of this is that if a pulse operation has no indicated scale, the most recently applied scale factor is used. Otherwise, there are no changes to behavior. For example,

SetScale(frame=f, scale=x)
Pulse(..., frame=f, scale=None)

is equivalent to

Pulse(..., frame=f, scale=x)

whereas

SetScale(..., frame=f, scale=x)
Pulse(..., frame=f, scale=y)

is equivalent to

Pulse(...,frame=f, scale=y)

Also, all frames start with a default scaling factor of 1.0.