qcs_api_client_grpc/gen/
models.controller.rs

1// Copyright 2023 Rigetti Computing
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15
16// This file is @generated by prost-build.
17/// Complex64 is a 64-bit complex value with float32 real and imaginary parts
18#[derive(Clone, Copy, PartialEq, ::prost::Message)]
19pub struct Complex64 {
20    #[prost(float, tag = "1")]
21    pub real: f32,
22    #[prost(float, tag = "2")]
23    pub imaginary: f32,
24}
25/// ReadoutValues are data readout values that have been read out from the quantum processor
26/// and optionally processed by a readout transformation pipeline.
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct ReadoutValues {
29    #[prost(oneof = "readout_values::Values", tags = "1, 2")]
30    pub values: ::core::option::Option<readout_values::Values>,
31}
32/// Nested message and enum types in `ReadoutValues`.
33pub mod readout_values {
34    #[derive(Clone, PartialEq, ::prost::Oneof)]
35    pub enum Values {
36        #[prost(message, tag = "1")]
37        IntegerValues(super::IntegerReadoutValues),
38        #[prost(message, tag = "2")]
39        ComplexValues(super::Complex64ReadoutValues),
40    }
41}
42/// IntegerReadoutValues are integer arrays emitted by a readout receiver or transformation pipeline.
43/// These may include (but are not limited to) qudit values or raw ADC capture data.
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct IntegerReadoutValues {
46    #[prost(int32, repeated, tag = "1")]
47    pub values: ::prost::alloc::vec::Vec<i32>,
48}
49/// Complex64ReadoutValues are arrays of complex numbers emitted by a readout receiver or transformation pipeline.
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct Complex64ReadoutValues {
52    #[prost(message, repeated, tag = "1")]
53    pub values: ::prost::alloc::vec::Vec<Complex64>,
54}
55/// An EncryptedControllerJob includes the configuration necessary to execute an instance of
56/// the contained job data on control hardware in encrypted format.
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct EncryptedControllerJob {
59    /// Encrypted form of ControllerJob.
60    #[prost(bytes = "vec", tag = "1")]
61    pub job: ::prost::alloc::vec::Vec<u8>,
62    /// Information about the means by which `inner` was encrypted.
63    #[prost(message, optional, tag = "2")]
64    pub encryption: ::core::option::Option<JobEncryption>,
65}
66/// Information about the means by which a ControllerJob was encrypted.
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct JobEncryption {
69    /// Opaque identifier for the key to use in decryption
70    #[prost(string, tag = "1")]
71    pub key_id: ::prost::alloc::string::String,
72    /// If relevant, the nonce to use in decryption
73    #[prost(bytes = "vec", tag = "2")]
74    pub nonce: ::prost::alloc::vec::Vec<u8>,
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct JobExecutionConfiguration {
78    /// Memory values to be patched into the program by the Controller Service prior to execution.
79    /// The string key is used to match the name of the memory region as defined in the
80    /// InstrumentProgram. The type of the DataValue must match the defined type of the region.
81    #[prost(map = "string, message", tag = "3")]
82    pub memory_values: ::std::collections::HashMap<
83        ::prost::alloc::string::String,
84        DataValue,
85    >,
86}
87/// The value of the data to insert into memory corresponding to a MemoryRegion.
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct DataValue {
90    #[prost(oneof = "data_value::Value", tags = "101, 102, 103")]
91    pub value: ::core::option::Option<data_value::Value>,
92}
93/// Nested message and enum types in `DataValue`.
94pub mod data_value {
95    #[derive(Clone, PartialEq, ::prost::Oneof)]
96    pub enum Value {
97        /// Binary value, corresponding to both BIT and OCTET data types in Quil.
98        #[prost(message, tag = "101")]
99        Binary(super::BinaryDataValue),
100        /// Signed integer value, corresponding to INTEGER in Quil.
101        #[prost(message, tag = "102")]
102        Integer(super::IntegerDataValue),
103        /// Real number value, corresponding to REAL in Quil.
104        #[prost(message, tag = "103")]
105        Real(super::RealDataValue),
106    }
107}
108/// Binary value, corresponding to both BIT and OCTET data types in Quil.
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct BinaryDataValue {
111    #[prost(bytes = "vec", tag = "1")]
112    pub data: ::prost::alloc::vec::Vec<u8>,
113}
114/// Signed integer value, corresponding to INTEGER in Quil.
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct IntegerDataValue {
117    #[prost(int64, repeated, tag = "1")]
118    pub data: ::prost::alloc::vec::Vec<i64>,
119}
120/// Real number value, corresponding to REAL in Quil.
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct RealDataValue {
123    #[prost(double, repeated, tag = "1")]
124    pub data: ::prost::alloc::vec::Vec<f64>,
125}
126/// A ControllerJobExecutionResult includes the result data from a single
127/// execution of a ControllerJob.
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct ControllerJobExecutionResult {
130    /// The contents of each memory region, keyed on region name
131    #[prost(map = "string, message", tag = "1")]
132    pub memory_values: ::std::collections::HashMap<
133        ::prost::alloc::string::String,
134        DataValue,
135    >,
136    /// The contents of readout data published by the readout transformation
137    /// pipeline, keyed on the node ID of the publishing readout transformation
138    /// node.
139    #[prost(map = "string, message", tag = "2")]
140    pub readout_values: ::std::collections::HashMap<
141        ::prost::alloc::string::String,
142        ReadoutValues,
143    >,
144    #[prost(enumeration = "controller_job_execution_result::Status", tag = "3")]
145    pub status: i32,
146    /// Optional message providing context to the result's status.
147    #[prost(string, optional, tag = "4")]
148    pub status_message: ::core::option::Option<::prost::alloc::string::String>,
149    /// Duration (µs) job held exclusive access to control hardware.
150    #[prost(uint64, tag = "5")]
151    pub execution_duration_microseconds: u64,
152}
153/// Nested message and enum types in `ControllerJobExecutionResult`.
154pub mod controller_job_execution_result {
155    #[derive(
156        Clone,
157        Copy,
158        Debug,
159        PartialEq,
160        Eq,
161        Hash,
162        PartialOrd,
163        Ord,
164        ::prost::Enumeration
165    )]
166    #[repr(i32)]
167    pub enum Status {
168        Unknown = 0,
169        Success = 1,
170        /// Failure state caused by an error in the service.
171        ServiceFailure = 2,
172        /// Failure state caused by user.
173        UserFailure = 3,
174        /// Job was canceled by user before execution completed.
175        UserCancellation = 4,
176    }
177    impl Status {
178        /// String value of the enum field names used in the ProtoBuf definition.
179        ///
180        /// The values are not transformed in any way and thus are considered stable
181        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
182        pub fn as_str_name(&self) -> &'static str {
183            match self {
184                Self::Unknown => "UNKNOWN",
185                Self::Success => "SUCCESS",
186                Self::ServiceFailure => "SERVICE_FAILURE",
187                Self::UserFailure => "USER_FAILURE",
188                Self::UserCancellation => "USER_CANCELLATION",
189            }
190        }
191        /// Creates an enum from field names used in the ProtoBuf definition.
192        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
193            match value {
194                "UNKNOWN" => Some(Self::Unknown),
195                "SUCCESS" => Some(Self::Success),
196                "SERVICE_FAILURE" => Some(Self::ServiceFailure),
197                "USER_FAILURE" => Some(Self::UserFailure),
198                "USER_CANCELLATION" => Some(Self::UserCancellation),
199                _ => None,
200            }
201        }
202    }
203}
204