quantum-forge 2.5.2 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/quantum.d.ts +8 -1
- package/dist/quantum-forge-qubit/quantum-forge-web-api.d.mts +7 -1
- package/dist/quantum-forge-qubit/quantum-forge-web-api.mjs +6 -0
- package/dist/quantum-forge-qubit/quantum-forge-web-esm.wasm +0 -0
- package/dist/quantum-forge-web-api.d.mts +7 -1
- package/dist/quantum-forge-web-api.mjs +6 -0
- package/dist/quantum-forge-web-esm.wasm +0 -0
- package/package.json +1 -1
package/dist/lib/quantum.d.ts
CHANGED
|
@@ -56,7 +56,13 @@ declare function phase_rotate(predicates: Predicate[], angle: number): void;
|
|
|
56
56
|
declare function measure_properties(props: QuantumProperty[]): number[];
|
|
57
57
|
declare function forced_measure_properties(props: QuantumProperty[], forcedValues: number[]): number[];
|
|
58
58
|
declare function measure_predicate(predicates: Predicate[]): number;
|
|
59
|
+
/** Force a predicate measurement to a specific outcome.
|
|
60
|
+
* If the forced value is impossible (zero probability), falls back to
|
|
61
|
+
* stochastic measurement and returns the actual outcome instead of throwing. */
|
|
59
62
|
declare function forced_measure_predicate(predicates: Predicate[], forcedValue: number): number;
|
|
63
|
+
/** Get the probability that all predicates are simultaneously satisfied.
|
|
64
|
+
* Read-only — does not collapse or modify quantum state. */
|
|
65
|
+
declare function predicate_probability(predicates: Predicate[]): number;
|
|
60
66
|
declare function probabilities(props: QuantumProperty[]): Array<{
|
|
61
67
|
probability: number;
|
|
62
68
|
qudit_values: number[];
|
|
@@ -200,6 +206,7 @@ declare const __quantum_forge_api_mjs_inverse_hadamard: typeof inverse_hadamard;
|
|
|
200
206
|
declare const __quantum_forge_api_mjs_measure_predicate: typeof measure_predicate;
|
|
201
207
|
declare const __quantum_forge_api_mjs_measure_properties: typeof measure_properties;
|
|
202
208
|
declare const __quantum_forge_api_mjs_phase_rotate: typeof phase_rotate;
|
|
209
|
+
declare const __quantum_forge_api_mjs_predicate_probability: typeof predicate_probability;
|
|
203
210
|
declare const __quantum_forge_api_mjs_probabilities: typeof probabilities;
|
|
204
211
|
declare const __quantum_forge_api_mjs_reduced_density_matrix: typeof reduced_density_matrix;
|
|
205
212
|
declare const __quantum_forge_api_mjs_reset: typeof reset;
|
|
@@ -209,7 +216,7 @@ declare const __quantum_forge_api_mjs_x: typeof x;
|
|
|
209
216
|
declare const __quantum_forge_api_mjs_y: typeof y;
|
|
210
217
|
declare const __quantum_forge_api_mjs_z: typeof z;
|
|
211
218
|
declare namespace __quantum_forge_api_mjs {
|
|
212
|
-
export { type __quantum_forge_api_mjs_BatchOp as BatchOp, type __quantum_forge_api_mjs_BatchResult as BatchResult, OP$1 as OP, type __quantum_forge_api_mjs_OpCode as OpCode, type __quantum_forge_api_mjs_OpNum as OpNum, __quantum_forge_api_mjs_Predicate as Predicate, __quantum_forge_api_mjs_QuantumForge as QuantumForge, __quantum_forge_api_mjs_QuantumProperty as QuantumProperty, __quantum_forge_api_mjs_QuantumSimulation as QuantumSimulation, __quantum_forge_api_mjs_clock as clock, __quantum_forge_api_mjs_cycle as cycle, __quantum_forge_api_mjs_executeBatch as executeBatch, __quantum_forge_api_mjs_executeBatchTape as executeBatchTape, __quantum_forge_api_mjs_forced_measure_predicate as forced_measure_predicate, __quantum_forge_api_mjs_forced_measure_properties as forced_measure_properties, __quantum_forge_api_mjs_hadamard as hadamard, __quantum_forge_api_mjs_i_swap as i_swap, __quantum_forge_api_mjs_inverse_hadamard as inverse_hadamard, __quantum_forge_api_mjs_measure_predicate as measure_predicate, __quantum_forge_api_mjs_measure_properties as measure_properties, __quantum_forge_api_mjs_phase_rotate as phase_rotate, __quantum_forge_api_mjs_probabilities as probabilities, __quantum_forge_api_mjs_reduced_density_matrix as reduced_density_matrix, __quantum_forge_api_mjs_reset as reset, __quantum_forge_api_mjs_shift as shift, __quantum_forge_api_mjs_swap as swap, __quantum_forge_api_mjs_x as x, __quantum_forge_api_mjs_y as y, __quantum_forge_api_mjs_z as z };
|
|
219
|
+
export { type __quantum_forge_api_mjs_BatchOp as BatchOp, type __quantum_forge_api_mjs_BatchResult as BatchResult, OP$1 as OP, type __quantum_forge_api_mjs_OpCode as OpCode, type __quantum_forge_api_mjs_OpNum as OpNum, __quantum_forge_api_mjs_Predicate as Predicate, __quantum_forge_api_mjs_QuantumForge as QuantumForge, __quantum_forge_api_mjs_QuantumProperty as QuantumProperty, __quantum_forge_api_mjs_QuantumSimulation as QuantumSimulation, __quantum_forge_api_mjs_clock as clock, __quantum_forge_api_mjs_cycle as cycle, __quantum_forge_api_mjs_executeBatch as executeBatch, __quantum_forge_api_mjs_executeBatchTape as executeBatchTape, __quantum_forge_api_mjs_forced_measure_predicate as forced_measure_predicate, __quantum_forge_api_mjs_forced_measure_properties as forced_measure_properties, __quantum_forge_api_mjs_hadamard as hadamard, __quantum_forge_api_mjs_i_swap as i_swap, __quantum_forge_api_mjs_inverse_hadamard as inverse_hadamard, __quantum_forge_api_mjs_measure_predicate as measure_predicate, __quantum_forge_api_mjs_measure_properties as measure_properties, __quantum_forge_api_mjs_phase_rotate as phase_rotate, __quantum_forge_api_mjs_predicate_probability as predicate_probability, __quantum_forge_api_mjs_probabilities as probabilities, __quantum_forge_api_mjs_reduced_density_matrix as reduced_density_matrix, __quantum_forge_api_mjs_reset as reset, __quantum_forge_api_mjs_shift as shift, __quantum_forge_api_mjs_swap as swap, __quantum_forge_api_mjs_x as x, __quantum_forge_api_mjs_y as y, __quantum_forge_api_mjs_z as z };
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
/**
|
|
@@ -54,7 +54,13 @@ declare function phase_rotate(predicates: Predicate[], angle: number): void;
|
|
|
54
54
|
declare function measure_properties(props: QuantumProperty[]): number[];
|
|
55
55
|
declare function forced_measure_properties(props: QuantumProperty[], forcedValues: number[]): number[];
|
|
56
56
|
declare function measure_predicate(predicates: Predicate[]): number;
|
|
57
|
+
/** Force a predicate measurement to a specific outcome.
|
|
58
|
+
* If the forced value is impossible (zero probability), falls back to
|
|
59
|
+
* stochastic measurement and returns the actual outcome instead of throwing. */
|
|
57
60
|
declare function forced_measure_predicate(predicates: Predicate[], forcedValue: number): number;
|
|
61
|
+
/** Get the probability that all predicates are simultaneously satisfied.
|
|
62
|
+
* Read-only — does not collapse or modify quantum state. */
|
|
63
|
+
declare function predicate_probability(predicates: Predicate[]): number;
|
|
58
64
|
declare function probabilities(props: QuantumProperty[]): Array<{
|
|
59
65
|
probability: number;
|
|
60
66
|
qudit_values: number[];
|
|
@@ -174,4 +180,4 @@ declare class QuantumForge {
|
|
|
174
180
|
static getMaxStateSize(): number;
|
|
175
181
|
}
|
|
176
182
|
|
|
177
|
-
export { type BatchOp, type BatchResult, OP, type OpCode, type OpNum, Predicate, QuantumForge, QuantumProperty, QuantumSimulation, clock, cycle, executeBatch, executeBatchTape, forced_measure_predicate, forced_measure_properties, hadamard, i_swap, inverse_hadamard, measure_predicate, measure_properties, phase_rotate, probabilities, reduced_density_matrix, reset, shift, swap, x, y, z };
|
|
183
|
+
export { type BatchOp, type BatchResult, OP, type OpCode, type OpNum, Predicate, QuantumForge, QuantumProperty, QuantumSimulation, clock, cycle, executeBatch, executeBatchTape, forced_measure_predicate, forced_measure_properties, hadamard, i_swap, inverse_hadamard, measure_predicate, measure_properties, phase_rotate, predicate_probability, probabilities, reduced_density_matrix, reset, shift, swap, x, y, z };
|
|
@@ -177,6 +177,11 @@ function forced_measure_predicate(predicates, forcedValue) {
|
|
|
177
177
|
const cppPredicates = predicates.map((pred) => pred.getCppInstance());
|
|
178
178
|
return wasmModule.forced_measure_predicate(cppPredicates, forcedValue);
|
|
179
179
|
}
|
|
180
|
+
function predicate_probability(predicates) {
|
|
181
|
+
if (!wasmModule) throw new Error("QuantumForge not initialized. Call QuantumForge.initialize() first.");
|
|
182
|
+
const cppPredicates = predicates.map((pred) => pred.getCppInstance());
|
|
183
|
+
return wasmModule.predicate_probability(cppPredicates);
|
|
184
|
+
}
|
|
180
185
|
function probabilities(props) {
|
|
181
186
|
if (!wasmModule) throw new Error("QuantumForge not initialized. Call QuantumForge.initialize() first.");
|
|
182
187
|
const cppProps = props.map((prop) => prop.getCppInstance());
|
|
@@ -292,6 +297,7 @@ export {
|
|
|
292
297
|
measure_predicate,
|
|
293
298
|
measure_properties,
|
|
294
299
|
phase_rotate,
|
|
300
|
+
predicate_probability,
|
|
295
301
|
probabilities,
|
|
296
302
|
reduced_density_matrix,
|
|
297
303
|
reset,
|
|
Binary file
|
|
@@ -54,7 +54,13 @@ declare function phase_rotate(predicates: Predicate[], angle: number): void;
|
|
|
54
54
|
declare function measure_properties(props: QuantumProperty[]): number[];
|
|
55
55
|
declare function forced_measure_properties(props: QuantumProperty[], forcedValues: number[]): number[];
|
|
56
56
|
declare function measure_predicate(predicates: Predicate[]): number;
|
|
57
|
+
/** Force a predicate measurement to a specific outcome.
|
|
58
|
+
* If the forced value is impossible (zero probability), falls back to
|
|
59
|
+
* stochastic measurement and returns the actual outcome instead of throwing. */
|
|
57
60
|
declare function forced_measure_predicate(predicates: Predicate[], forcedValue: number): number;
|
|
61
|
+
/** Get the probability that all predicates are simultaneously satisfied.
|
|
62
|
+
* Read-only — does not collapse or modify quantum state. */
|
|
63
|
+
declare function predicate_probability(predicates: Predicate[]): number;
|
|
58
64
|
declare function probabilities(props: QuantumProperty[]): Array<{
|
|
59
65
|
probability: number;
|
|
60
66
|
qudit_values: number[];
|
|
@@ -174,4 +180,4 @@ declare class QuantumForge {
|
|
|
174
180
|
static getMaxStateSize(): number;
|
|
175
181
|
}
|
|
176
182
|
|
|
177
|
-
export { type BatchOp, type BatchResult, OP, type OpCode, type OpNum, Predicate, QuantumForge, QuantumProperty, QuantumSimulation, clock, cycle, executeBatch, executeBatchTape, forced_measure_predicate, forced_measure_properties, hadamard, i_swap, inverse_hadamard, measure_predicate, measure_properties, phase_rotate, probabilities, reduced_density_matrix, reset, shift, swap, x, y, z };
|
|
183
|
+
export { type BatchOp, type BatchResult, OP, type OpCode, type OpNum, Predicate, QuantumForge, QuantumProperty, QuantumSimulation, clock, cycle, executeBatch, executeBatchTape, forced_measure_predicate, forced_measure_properties, hadamard, i_swap, inverse_hadamard, measure_predicate, measure_properties, phase_rotate, predicate_probability, probabilities, reduced_density_matrix, reset, shift, swap, x, y, z };
|
|
@@ -177,6 +177,11 @@ function forced_measure_predicate(predicates, forcedValue) {
|
|
|
177
177
|
const cppPredicates = predicates.map((pred) => pred.getCppInstance());
|
|
178
178
|
return wasmModule.forced_measure_predicate(cppPredicates, forcedValue);
|
|
179
179
|
}
|
|
180
|
+
function predicate_probability(predicates) {
|
|
181
|
+
if (!wasmModule) throw new Error("QuantumForge not initialized. Call QuantumForge.initialize() first.");
|
|
182
|
+
const cppPredicates = predicates.map((pred) => pred.getCppInstance());
|
|
183
|
+
return wasmModule.predicate_probability(cppPredicates);
|
|
184
|
+
}
|
|
180
185
|
function probabilities(props) {
|
|
181
186
|
if (!wasmModule) throw new Error("QuantumForge not initialized. Call QuantumForge.initialize() first.");
|
|
182
187
|
const cppProps = props.map((prop) => prop.getCppInstance());
|
|
@@ -292,6 +297,7 @@ export {
|
|
|
292
297
|
measure_predicate,
|
|
293
298
|
measure_properties,
|
|
294
299
|
phase_rotate,
|
|
300
|
+
predicate_probability,
|
|
295
301
|
probabilities,
|
|
296
302
|
reduced_density_matrix,
|
|
297
303
|
reset,
|
|
Binary file
|
package/package.json
CHANGED