qcs_sdk.qvm
Client used to communicate with QVM.
Options avaialable for running programs on the QVM.
Get the default set of QVMOptions used for QVM requests.
Settings: timeout: 30.0 seconds
Encapsulates data returned after running a program on the QVM
Build a [QvmResultData] from a mapping of register names to a [RegisterData]
Get a copy of this result data flattened into a RawQVMReadoutData.
Convert into a [RegisterMap].
The [RegisterMatrix] for each register will be
constructed such that each row contains all the final values in the register for a single shot.
Errors
Returns a [RegisterMatrixConversionError] if the inner execution data for any of the
registers would result in a jagged matrix.
This is often the case in programs that use mid-circuit measurement or dynamic control flow,
where measurements to the same memory reference might occur multiple times in a shot, or be
skipped conditionally. In these cases, building a rectangular [RegisterMatrix] would
necessitate making assumptions about the data that could skew the data in undesirable ways.
Instead, it's recommended to manually build a matrix from [QpuResultData] that accurately
selects the last value per-shot based on the program that was run.
Encapsulates raw data returned from the QVM after executing a program.
Errors that can occur when running a Quil program on QVM.
Runs the given program on the QVM.
Parameters
- quil: A quil program as a string.
- shots: The number of times to run the program. Should be a value greater than zero.
- addresses: A mapping of memory region names to an
AddressRequestdescribing what data to get back for that memory region from the QVM at the end of execution. - params: A mapping of memory region names to their desired values.
- client: An optional
QCSClientto use. If unset, creates one using the environemnt configuration (see https: //docs.rigetti.com/qcs/references/qcs-client-configuration). - options: An optional
QVMOptionsto use. If unset, usesQVMOptions.default()for the request.
:returns: A QVMResultData containing the final state of of memory for the requested readouts after the program finished running.
Raises
- QVMError: If one of the parameters is invalid, or if there was a problem communicating with the QVM server.
Runs the given program on the QVM.
Parameters
- quil: A quil program as a string.
- shots: The number of times to run the program. Should be a value greater than zero.
- addresses: A mapping of memory region names to an
AddressRequestdescribing what data to get back for that memory region from the QVM at the end of execution. - params: A mapping of memory region names to their desired values.
- client: An optional
QCSClientto use. If unset, creates one using the environemnt configuration (see https: //docs.rigetti.com/qcs/references/qcs-client-configuration). - options: An optional
QVMOptionsto use. If unset, usesQVMOptions.default()for the request.
:returns: A QVMResultData containing the final state of of memory for the requested readouts after the program finished running.
Raises
- QVMError: If one of the parameters is invalid, or if there was a problem communicating with the QVM server.