Skip to content

Commit

Permalink
Merge pull request #2 from qsharp-community/feature/1.3.1
Browse files Browse the repository at this point in the history
updated to QDK 1.3.1
  • Loading branch information
filipw authored Mar 26, 2024
2 parents 5c2af72 + 6ddd46d commit 803f148
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 20 deletions.
99 changes: 83 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ edition = "2021"
crate-type = ["lib", "cdylib", "staticlib"]

[dependencies]
qsc = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.1.3" }
resource_estimator = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.1.3" }
qsc = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.3.1" }
resource_estimator = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.3.1" }
uniffi = { version = "0.23.0", features=["build"] }
thiserror = "1.0"
num-bigint = "0.4.3"
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use num_bigint::BigUint;
use num_complex::Complex64;
use qsc::interpret::output::Receiver;
use qsc::interpret::output;
use qsc::{SourceMap, PackageType, RuntimeCapabilityFlags};
use qsc::{format_state_id, LanguageFeatures, PackageType, RuntimeCapabilityFlags, SourceMap};

#[derive(Error, Debug)]
pub enum QsError {
Expand Down Expand Up @@ -63,6 +63,7 @@ pub fn run_qs(source: &str) -> Result<ExecutionState, QsError> {
source_map,
PackageType::Exe,
RuntimeCapabilityFlags::all(),
LanguageFeatures::default()
) {
Ok(interpreter) => interpreter,
Err(errors) => {
Expand All @@ -86,6 +87,7 @@ pub fn run_qs_shots(source: &str, shots: u32) -> Result<Vec<ExecutionState>, QsE
source_map,
PackageType::Exe,
RuntimeCapabilityFlags::all(),
LanguageFeatures::default()
) {
Ok(interpreter) => interpreter,
Err(errors) => {
Expand All @@ -109,6 +111,7 @@ pub fn qir(expression: &str) -> Result<String, QsError> {
SourceMap::default(),
PackageType::Lib,
RuntimeCapabilityFlags::empty(),
LanguageFeatures::default()
) {
Ok(interpreter) => interpreter,
Err(errors) => {
Expand All @@ -127,6 +130,7 @@ pub fn estimate(source: &str, job_params: Option<String>) -> Result<String, QsEr
source_map,
PackageType::Exe,
RuntimeCapabilityFlags::empty(),
LanguageFeatures::default()
) {
Ok(interpreter) => interpreter,
Err(errors) => {
Expand All @@ -145,6 +149,7 @@ pub fn estimate_expression(expression: &str, job_params: Option<String>) -> Resu
SourceMap::default(),
PackageType::Lib,
RuntimeCapabilityFlags::empty(),
LanguageFeatures::default()
) {
Ok(interpreter) => interpreter,
Err(errors) => {
Expand Down Expand Up @@ -197,7 +202,7 @@ impl Receiver for ExecutionState {
self.qubit_count = qubit_count as u64;
self.states = states.iter().map(|(qubit, amplitude)| {
QubitState {
id: output::format_state_id(&qubit, qubit_count),
id: format_state_id(&qubit, qubit_count),
amplitude_real: amplitude.re,
amplitude_imaginary: amplitude.im,
}
Expand Down

0 comments on commit 803f148

Please sign in to comment.