pub enum Error {
Show 14 variants Settings(String), Authentication, QpuNotFound, QpuUnavailable(Duration), Connection(Service), Quil(ProgramError<Program>), Compilation(String), Translation(String), RewriteArithmetic(Error), Substitution(String), MissingRoSources, Unexpected(String), InvalidJobHandle, QcsConfigLoadFailure(LoadError),
}
Expand description

The possible errors which can be returned by Executable::execute_on_qpu and Executable::execute_on_qvm..

Variants

Settings(String)

Communicating with QCS requires appropriate settings and secrets files. By default, these should be $HOME/.qcs/settings.toml and $HOME/.qcs/secrets.toml, though those files can be overridden by setting the QCS_SETTINGS_FILE_PATH and QCS_SECRETS_FILE_PATH environment variables.

This error can occur when one of those files is required but missing or there is a problem with the contents of those files.

Authentication

This error occurs when the SDK was unable to authenticate a request to QCS. This could mean that your credentials are invalid or expired, or that you do not have access to the requested QPU.

QpuNotFound

The requested QPU was not found. Either the QPU does not exist or you do not have access to it.

QpuUnavailable(Duration)

This happens when the QPU is down for maintenance and not accepting new jobs. If you receive this error, internal compilation caches will have been cleared as programs should be recompiled with new settings after a maintenance window. If you are mid-experiment, you might want to start over.

Connection(Service)

Indicates a problem connecting to an external service. Check your network connection and ensure that any required local services (e.g., qvm or quilc) are running.

Quil(ProgramError<Program>)

There was some problem with the provided Quil program. This could be a syntax error with quil, providing Quil-T to quilc or qvm (which is not supported), or forgetting to set some parameters.

Compilation(String)

There was a problem when compiling the Quil program.

Translation(String)

There was a problem when translating the Quil program.

RewriteArithmetic(Error)

There was a problem when rewriting parameter arithmetic in the Quil program.

Substitution(String)

There was a problem when substituting parameters in the Quil program.

MissingRoSources

The Quil program is missing readout sources.

Unexpected(String)

This error returns when a runtime check that should always pass fails. This most likely indicates a bug in the SDK and should be reported to GitHub,

InvalidJobHandle

Occurs when Executable::retrieve_results is called with an invalid JobHandle. Calling functions on Executable between Executable::submit_to_qpu and Executable::retrieve_results can invalidate the handle.

QcsConfigLoadFailure(LoadError)

Occurs when failing to construct a [QcsClient].

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more