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