qcs_api_client_openapi/models/
instruction_set_architecture.rs

1// Copyright 2022 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 * Rigetti QCS API
17 *
18 * # Introduction  This is the documentation for the Rigetti QCS HTTP API.  You can find out more about Rigetti at [https://rigetti.com](https://rigetti.com), and also interact with QCS via the web at [https://qcs.rigetti.com](https://qcs.rigetti.com).  This API is documented in **OpenAPI format** and so is compatible with the dozens of language-specific client generators available [here](https://github.com/OpenAPITools/openapi-generator) and elsewhere on the web.  # Principles  This API follows REST design principles where appropriate, and otherwise an HTTP RPC paradigm. We adhere to the Google [API Improvement Proposals](https://google.aip.dev/general) where reasonable to provide a consistent, intuitive developer experience. HTTP response codes match their specifications, and error messages fit a common format.  # Authentication  All access to the QCS API requires OAuth2 authentication provided by Okta. You can request access [here](https://www.rigetti.com/get-quantum). Once you have a user account, you can download your access token from QCS [here](https://qcs.rigetti.com/auth/token).   That access token is valid for 24 hours after issuance. The value of `access_token` within the JSON file is the token used for authentication (don't use the entire JSON file).  Authenticate requests using the `Authorization` header and a `Bearer` prefix:  ``` curl --header \"Authorization: Bearer eyJraW...Iow\" ```  # Quantum Processor Access  Access to the quantum processors themselves is not yet provided directly by this HTTP API, but is instead performed over ZeroMQ/[rpcq](https://github.com/rigetti/rpcq). Until that changes, we suggest using [pyquil](https://github.com/rigetti/pyquil) to build and execute quantum programs via the Legacy API.  # Legacy API  Our legacy HTTP API remains accessible at https://forest-server.qcs.rigetti.com, and it shares a source of truth with this API's services. You can use either service with the same user account and means of authentication. We strongly recommend using the API documented here, as the legacy API is on the path to deprecation.
19 *
20 * The version of the OpenAPI document: 2020-07-31
21 * Contact: support@rigetti.com
22 * Generated by: https://openapi-generator.tech
23 */
24
25/// InstructionSetArchitecture : The native instruction set architecture of a quantum processor, annotated with characteristics.  The operations described by the `instructions` field are named by their QUIL instruction name, while the operation described by the `benchmarks` field are named by their benchmark routine and are a future extension point that will be populated in future iterations.  The characteristics that annotate both instructions and benchmarks assist the user to generate the best native QUIL program for a desired task, and so are provided as part of the native ISA.
26use serde::{Deserialize, Serialize};
27
28#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
29pub struct InstructionSetArchitecture {
30    #[serde(rename = "architecture")]
31    pub architecture: Box<crate::models::Architecture>,
32    /// The list of benchmarks that have characterized the quantum processor.
33    #[serde(rename = "benchmarks")]
34    pub benchmarks: Vec<crate::models::Operation>,
35    /// The list of native QUIL instructions supported by the quantum processor.
36    #[serde(rename = "instructions")]
37    pub instructions: Vec<crate::models::Operation>,
38    /// The name of the quantum processor.
39    #[serde(rename = "name")]
40    pub name: String,
41}
42
43impl InstructionSetArchitecture {
44    /// The native instruction set architecture of a quantum processor, annotated with characteristics.  The operations described by the `instructions` field are named by their QUIL instruction name, while the operation described by the `benchmarks` field are named by their benchmark routine and are a future extension point that will be populated in future iterations.  The characteristics that annotate both instructions and benchmarks assist the user to generate the best native QUIL program for a desired task, and so are provided as part of the native ISA.
45    pub fn new(
46        architecture: crate::models::Architecture,
47        benchmarks: Vec<crate::models::Operation>,
48        instructions: Vec<crate::models::Operation>,
49        name: String,
50    ) -> InstructionSetArchitecture {
51        InstructionSetArchitecture {
52            architecture: Box::new(architecture),
53            benchmarks,
54            instructions,
55            name,
56        }
57    }
58}