From bb902963fc721e0af357a46191d17f5b7f082e76 Mon Sep 17 00:00:00 2001 From: kamakiri01 Date: Tue, 26 Dec 2023 15:31:44 +0900 Subject: [PATCH 1/4] fix update_quantum_state type --- src-ts/main/type/QulacsClass.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ts/main/type/QulacsClass.ts b/src-ts/main/type/QulacsClass.ts index d9c2c46..61c91d3 100644 --- a/src-ts/main/type/QulacsClass.ts +++ b/src-ts/main/type/QulacsClass.ts @@ -58,7 +58,7 @@ export type DensityMatrixImpl = QuantumStateBase & { export interface QuantumCircuitImpl { new (qubit_count: number): QuantumCircuitImpl; - update_quantum_state(state: QuantumState, start_index?: number, end_index?: number): void; + update_quantum_state(state: QuantumStateBase, start_index?: number, end_index?: number): void; to_string(): string; copy(): QuantumCircuitImpl; add_gate(gate: QuantumGateBase, index?: number): void; @@ -118,7 +118,7 @@ export interface ParametricQuantumCircuitImpl extends QuantumCircuitImpl { } export interface QuantumGateBase { - update_quantum_state(state: QuantumState): void; + update_quantum_state(state: QuantumStateBase): void; to_string(): string; copy(): QuantumGateMatrix; get_matrix(): Complex[][]; From 9f472c23c5b9f546523e5edb51d96c0d0070f78c Mon Sep 17 00:00:00 2001 From: kamakiri01 Date: Tue, 26 Dec 2023 15:32:14 +0900 Subject: [PATCH 2/4] fix sample --- sample/node/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample/node/src/index.ts b/sample/node/src/index.ts index 58f3ba2..91d7d2f 100644 --- a/sample/node/src/index.ts +++ b/sample/node/src/index.ts @@ -1,7 +1,7 @@ import * as fs from "fs"; import * as path from "path"; import { Worker } from "worker_threads"; -import { initQulacs } from "qulacs-wasm"; +import { initQulacs, QuantumState } from "qulacs-wasm"; const USE_WORKER = false; if (USE_WORKER) { @@ -17,7 +17,7 @@ if (USE_WORKER) { } else { initQulacs() .then(async () => { - const { QuantumState, QuantumCircuit } = await import("qulacs-wasm"); + const { QuantumCircuit } = await import("qulacs-wasm"); const state = new QuantumState(3); const circuit = new QuantumCircuit(3); circuit.add_X_gate(0); From 6783fa59264e5e307d3a1bba2f56e980ab2aa043 Mon Sep 17 00:00:00 2001 From: kamakiri01 Date: Tue, 26 Dec 2023 15:33:53 +0900 Subject: [PATCH 3/4] bump version v0.0.5 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b560cd..47b4305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # ChangeLog +## 0.0.5 +- fix update_quantum_state type, enable to use DensityMatrix class + ## 0.0.4 - Reorganized type definition dependencies diff --git a/package.json b/package.json index a1cc0e5..7c55d6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qulacs-wasm", - "version": "0.0.4", + "version": "0.0.5", "description": "Qulacs WebAssembly version", "main": "lib/bundle/index.js", "scripts": { From 9ae17d89865d542812966ad0de06f326fa5fef91 Mon Sep 17 00:00:00 2001 From: kamakiri01 Date: Tue, 26 Dec 2023 15:35:04 +0900 Subject: [PATCH 4/4] fix lint --- src-ts/main/type/QulacsClass.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src-ts/main/type/QulacsClass.ts b/src-ts/main/type/QulacsClass.ts index 61c91d3..24e5a33 100644 --- a/src-ts/main/type/QulacsClass.ts +++ b/src-ts/main/type/QulacsClass.ts @@ -1,4 +1,3 @@ -import { QuantumState } from "../instance"; import { Complex } from "./common"; export interface QuantumStateBase {}