Skip to content

Commit

Permalink
Merge pull request #27 from kamakiri01/quantum-state-to-quantum-state…
Browse files Browse the repository at this point in the history
…-base

Quantum state to quantum state base
  • Loading branch information
kamakiri01 authored Dec 26, 2023
2 parents 0a83692 + 9ae17d8 commit b82da06
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions sample/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions src-ts/main/type/QulacsClass.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { QuantumState } from "../instance";
import { Complex } from "./common";

export interface QuantumStateBase {}
Expand Down Expand Up @@ -58,7 +57,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;
Expand Down Expand Up @@ -118,7 +117,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[][];
Expand Down

0 comments on commit b82da06

Please sign in to comment.