From df5b481196f0cb09da9d971613a3fe1d0d68406d Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Tue, 19 Oct 2021 12:17:44 -0600 Subject: [PATCH] Upgrade: Switch to released version of quil-rs --- .releaserc.yml | 2 ++ Cargo.lock | 15 ++++++++------- qcs/Cargo.toml | 2 +- qcs/src/qpu/execution.rs | 2 +- qcs/src/qpu/quilc/mod.rs | 4 ++-- qcs/src/qpu/rewrite_arithmetic.rs | 14 ++++++++------ qcs/src/qvm/execution.rs | 8 +++++--- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.releaserc.yml b/.releaserc.yml index 025183a74..893303043 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -9,6 +9,8 @@ plugins: release: minor - tag: Update release: patch + - tag: Upgrade + release: patch - tag: New release: patch - - '@semantic-release/release-notes-generator' diff --git a/Cargo.lock b/Cargo.lock index c308e9d01..6f48eec95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,7 +133,7 @@ dependencies = [ [[package]] name = "cli" -version = "0.0.0" +version = "0.0.1" dependencies = [ "clap", "env_logger", @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "qcs" -version = "0.0.0" +version = "0.0.1" dependencies = [ "dirs", "enum-as-inner", @@ -1088,7 +1088,7 @@ dependencies = [ "maplit", "num", "qcs-api", - "quil", + "quil-rs", "reqwest", "rmp-serde", "serde", @@ -1105,7 +1105,7 @@ dependencies = [ [[package]] name = "qcs-api" -version = "0.0.0" +version = "0.0.1" dependencies = [ "reqwest", "serde", @@ -1121,9 +1121,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] -name = "quil" -version = "0.5.3" -source = "git+https://github.com/rigetti/quil-rust.git?branch=sdk-requirements#747a9d6dc55eca86fa6c8ccd8924ab6afee124ff" +name = "quil-rs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99eb6a9f67b64905b282ba9cb06452e3e1bcc46bf9ee46bddf366e6528947da1" dependencies = [ "indexmap", "lexical", diff --git a/qcs/Cargo.toml b/qcs/Cargo.toml index 86505d996..cf33b214b 100644 --- a/qcs/Cargo.toml +++ b/qcs/Cargo.toml @@ -21,7 +21,7 @@ lazy_static = "1.4.0" log = "0.4.14" num = "0.4.0" qcs-api = { version ="0.0.1", path = "../qcs-api" } -quil = { version = "0.5.0", git = "https://github.com/rigetti/quil-rust.git", branch = "sdk-requirements" } +quil-rs = "0.8.0" reqwest = { version = "0.11.4", features = ["rustls", "json"] } rmp-serde = "0.15.5" serde = { version = "1.0.126", features = ["derive"] } diff --git a/qcs/src/qpu/execution.rs b/qcs/src/qpu/execution.rs index 0feb0a6ab..c4e8456bd 100644 --- a/qcs/src/qpu/execution.rs +++ b/qcs/src/qpu/execution.rs @@ -5,7 +5,7 @@ use std::convert::TryFrom; use eyre::{eyre, Report, Result, WrapErr}; use log::trace; -use quil::expression::Expression; +use quil_rs::expression::Expression; use qcs_api::models::EngagementWithCredentials; diff --git a/qcs/src/qpu/quilc/mod.rs b/qcs/src/qpu/quilc/mod.rs index 864a68247..dd0328563 100644 --- a/qcs/src/qpu/quilc/mod.rs +++ b/qcs/src/qpu/quilc/mod.rs @@ -3,7 +3,7 @@ use std::convert::TryFrom; use std::str::FromStr; use eyre::{Report, Result, WrapErr}; -use quil::Program; +use quil_rs::Program; use serde::{Deserialize, Serialize}; use isa::CompilerIsa; @@ -60,7 +60,7 @@ impl From for String { /// A wrapper around [`Program`] which indicates it has been converted to `NativeQuil` (has been run /// through `quilc` and therefore is suitable to use on QPUs. #[derive(Debug, PartialEq)] -pub struct NativeQuilProgram(Program); +pub(super) struct NativeQuilProgram(Program); impl TryFrom for NativeQuilProgram { type Error = Report; diff --git a/qcs/src/qpu/rewrite_arithmetic.rs b/qcs/src/qpu/rewrite_arithmetic.rs index e05e43cc4..9dfbb7b29 100644 --- a/qcs/src/qpu/rewrite_arithmetic.rs +++ b/qcs/src/qpu/rewrite_arithmetic.rs @@ -3,13 +3,15 @@ use std::convert::TryFrom; use eyre::{eyre, Report, Result}; use indexmap::set::IndexSet; use num::complex::Complex64; -use quil::expression::{Expression, InfixOperator}; -use quil::instruction::{ - AttributeValue, FrameIdentifier, Gate, Instruction, MemoryReference, ScalarType, SetFrequency, - SetPhase, SetScale, ShiftFrequency, ShiftPhase, Vector, +use quil_rs::{ + expression::{Expression, InfixOperator}, + instruction::{ + AttributeValue, FrameIdentifier, Gate, Instruction, MemoryReference, ScalarType, + SetFrequency, SetPhase, SetScale, ShiftFrequency, ShiftPhase, Vector, + }, + program::{FrameSet, MemoryRegion}, + Program, }; -use quil::program::{FrameSet, MemoryRegion}; -use quil::Program; use crate::qpu::quilc::NativeQuilProgram; diff --git a/qcs/src/qvm/execution.rs b/qcs/src/qvm/execution.rs index dd165f28d..841fbf0ff 100644 --- a/qcs/src/qvm/execution.rs +++ b/qcs/src/qvm/execution.rs @@ -1,15 +1,17 @@ +use std::collections::HashMap; use std::str::FromStr; use eyre::{eyre, Result, WrapErr}; -use quil::instruction::{ArithmeticOperand, Instruction, MemoryReference, Move}; -use quil::Program; +use quil_rs::{ + instruction::{ArithmeticOperand, Instruction, MemoryReference, Move}, + Program, +}; use crate::configuration::Configuration; use crate::executable::Parameters; use crate::ExecutionResult; use super::{QVMRequest, QVMResponse}; -use std::collections::HashMap; /// Contains all the info needed to execute on a QVM a single time, with the ability to be reused for /// faster subsequent runs.