@holoscript/core 8.0.14 → 8.0.16
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/README.md +6 -13
- package/bin/holo-decision.mjs +0 -0
- package/bin/holoscript.cjs +0 -0
- package/dist/{GLTFPipeline-6LS3UDYX.js → GLTFPipeline-FRBZIATS.js} +6 -6
- package/dist/{GLTFPipeline-VTI6PRRQ.cjs → GLTFPipeline-MTPP444P.cjs} +10 -10
- package/dist/{HoloCompositionParser-GILABNN3.js → HoloCompositionParser-2GVQAZ2X.js} +7 -7
- package/dist/HoloCompositionParser-3NDF6BMX.cjs +45 -0
- package/dist/HoloScriptPlusParser-URSIBEAW.cjs +30 -0
- package/dist/HoloScriptPlusParser-YCV6L7GI.js +13 -0
- package/dist/{HoloScriptRuntime-YBYXJHJN.cjs → HoloScriptRuntime-CRWI6C3P.cjs} +5 -5
- package/dist/{HoloScriptRuntime-UTRLJI5L.js → HoloScriptRuntime-IAZGHPFP.js} +4 -4
- package/dist/{SceneIRCompiler-VX75RB6H.js → SceneIRCompiler-BJQMKLWL.js} +6 -6
- package/dist/{SceneIRCompiler-7KQ5NKAU.cjs → SceneIRCompiler-RTPPDQAV.cjs} +11 -11
- package/dist/{chunk-Y2OCKXVD.js → chunk-22AULOAL.js} +5 -5
- package/dist/{chunk-D44CEFY4.cjs → chunk-2DJIS7TH.cjs} +5 -5
- package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
- package/dist/{chunk-M7XR3F53.js → chunk-2UP2J3OK.js} +4 -4
- package/dist/{chunk-3KHRZTNW.js → chunk-3AUYBQ5I.js} +3 -3
- package/dist/{chunk-UKEK2NZJ.js → chunk-3MQAOMKD.js} +3 -3
- package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
- package/dist/{chunk-7ITJP33Q.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
- package/dist/{chunk-47XZ62KM.js → chunk-4UA5OBWR.js} +5 -5
- package/dist/{chunk-ORBVCOTC.js → chunk-5LCJDX5A.js} +3 -3
- package/dist/{chunk-IK6Z2HNC.js → chunk-6OQHLNTT.js} +2 -2
- package/dist/{chunk-EI3J6LTW.cjs → chunk-6RDHWSZM.cjs} +217 -217
- package/dist/{chunk-73EDVY5D.js → chunk-7AY66PZP.js} +3 -3
- package/dist/{chunk-6FCNMTL5.js → chunk-7HDRN5BW.js} +4 -4
- package/dist/{chunk-N7MIIDLI.cjs → chunk-7IBXTJP7.cjs} +8 -8
- package/dist/{chunk-R5VKLUMR.js → chunk-AAUQTR7I.js} +4 -4
- package/dist/{chunk-HCONR4J6.cjs → chunk-AN3ZH7M7.cjs} +38 -38
- package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
- package/dist/{chunk-W4AJMMQR.js → chunk-AUF7HFOO.js} +60 -22
- package/dist/{chunk-SKVBUGMC.cjs → chunk-AUMTQV64.cjs} +7 -7
- package/dist/{chunk-7ZKQ32XK.js → chunk-B5K3WHJ4.js} +4 -4
- package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
- package/dist/{chunk-SE2Y5BSL.cjs → chunk-CMEINO5I.cjs} +186 -70
- package/dist/{chunk-YMI3ED3B.cjs → chunk-CRUIGXF7.cjs} +5 -5
- package/dist/chunk-DDBYJJZK.js +1571 -0
- package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
- package/dist/{chunk-GI5YYZH6.js → chunk-E4YS5SIZ.js} +90 -25
- package/dist/{chunk-62OYZT6Q.js → chunk-EKNWUSGW.js} +3 -3
- package/dist/{chunk-RVN7OPCP.js → chunk-ETIJOUIO.js} +4 -4
- package/dist/chunk-EUNELE7Y.cjs +1605 -0
- package/dist/{chunk-C73GVAYC.js → chunk-F33KLYOS.js} +5 -5
- package/dist/{chunk-4CRMVEON.cjs → chunk-F47FEV4X.cjs} +40 -40
- package/dist/{chunk-FGXJPJ3W.cjs → chunk-FCGTI7FO.cjs} +4 -4
- package/dist/{chunk-OSKGCXAQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
- package/dist/{chunk-XZC75AJ4.cjs → chunk-FPGYWNNA.cjs} +5 -5
- package/dist/{chunk-5B2AJKA5.cjs → chunk-FQ4MYZYU.cjs} +20 -20
- package/dist/{chunk-KOGPVAP6.js → chunk-FT4FGTR6.js} +3 -3
- package/dist/{chunk-N7IYRAFG.cjs → chunk-FVNV4WHQ.cjs} +14 -14
- package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
- package/dist/{chunk-TKDDIE3T.cjs → chunk-ILO2KMER.cjs} +4 -4
- package/dist/{chunk-GGH3ZYDB.cjs → chunk-IPBSNGAN.cjs} +92 -27
- package/dist/{chunk-JQCXLKAU.js → chunk-IX2U3RQT.js} +3 -3
- package/dist/{chunk-P65OIMJT.cjs → chunk-IYK6LMQ7.cjs} +7 -7
- package/dist/{chunk-NWKARJM2.js → chunk-J3VVM6GV.js} +4 -4
- package/dist/{chunk-FOM36K5I.cjs → chunk-J74S4ZMF.cjs} +18 -18
- package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
- package/dist/{chunk-VXHB6ZHY.js → chunk-JTDDLCSP.js} +4 -4
- package/dist/{chunk-GYJLP4BO.cjs → chunk-K53L47NH.cjs} +30 -30
- package/dist/{chunk-FHR2AVMA.cjs → chunk-LJTM5ONX.cjs} +23 -23
- package/dist/{chunk-JCVSCKUH.js → chunk-LJVVOVA6.js} +4 -4
- package/dist/{chunk-LQNL3IYV.cjs → chunk-LNJKBQ2B.cjs} +38 -38
- package/dist/{chunk-2GKF7JQ6.js → chunk-M2GDE3NV.js} +3 -3
- package/dist/{chunk-Z7NUL73U.js → chunk-MSZNGI5P.js} +3 -3
- package/dist/{chunk-B6JHTTMR.cjs → chunk-N2BOTBPG.cjs} +15 -15
- package/dist/{chunk-L4DBUX3N.cjs → chunk-NFALJJCH.cjs} +12 -12
- package/dist/{chunk-YBM34FUJ.cjs → chunk-NRZRBK25.cjs} +6 -6
- package/dist/{chunk-SNMQUWIO.cjs → chunk-NTSLNIY7.cjs} +10 -10
- package/dist/{chunk-645EWDZW.cjs → chunk-NZJOAWJM.cjs} +4 -4
- package/dist/{chunk-LGRKBTPM.js → chunk-OG7RKWWX.js} +3 -3
- package/dist/{chunk-OOP4S3GU.cjs → chunk-OQVHCYY4.cjs} +5 -5
- package/dist/{chunk-TMNAKNV2.cjs → chunk-PEBNX3VM.cjs} +5 -5
- package/dist/{chunk-5T6BWIB7.js → chunk-PFZ5WLIP.js} +4 -4
- package/dist/{chunk-CESMPUEZ.cjs → chunk-PHLNABJD.cjs} +159 -145
- package/dist/{chunk-CHIZSMWD.js → chunk-PLK3DLTF.js} +3 -3
- package/dist/{chunk-4NEPHK2K.js → chunk-PMACVMHL.js} +3 -3
- package/dist/{chunk-EYHPTJ3F.js → chunk-PV2OXNP5.js} +40 -26
- package/dist/{chunk-KLM6QD6D.cjs → chunk-Q6VW7MGX.cjs} +14 -14
- package/dist/{chunk-YDSNDCV3.js → chunk-QC3CAVFN.js} +186 -69
- package/dist/{chunk-REN3LHO6.cjs → chunk-QKLEDRHN.cjs} +19 -19
- package/dist/{chunk-2EGGAZT3.js → chunk-QS27OYBU.js} +3 -3
- package/dist/{chunk-4376VHNJ.js → chunk-RUB7WL6C.js} +3 -3
- package/dist/chunk-S2BSXG3B.js +3308 -0
- package/dist/{chunk-TZQKJOPC.js → chunk-TW2AH2ZS.js} +3 -3
- package/dist/{chunk-Q4J2K7FI.js → chunk-TZM6DKSJ.js} +6 -6
- package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
- package/dist/{chunk-ERYKKPHW.cjs → chunk-U6CQOM5Q.cjs} +13 -13
- package/dist/{chunk-VMCR5QVI.js → chunk-ULT2QAV5.js} +4 -4
- package/dist/chunk-VQOTDNFL.cjs +3337 -0
- package/dist/{chunk-VZI7S7P6.cjs → chunk-VSO6HPDZ.cjs} +7 -7
- package/dist/{chunk-QLPRI3QW.js → chunk-WQJMSSJT.js} +4 -4
- package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
- package/dist/{chunk-42Z3SVHQ.js → chunk-X5PMMK7H.js} +3 -3
- package/dist/{chunk-ML4V5PVU.cjs → chunk-X5ZLSPU2.cjs} +74 -32
- package/dist/{chunk-PSWCJQS4.js → chunk-X727CQ7X.js} +5 -5
- package/dist/{chunk-YM7UUYR5.cjs → chunk-XHZYS4QO.cjs} +5 -5
- package/dist/{chunk-PZ46WRHX.cjs → chunk-XRQCTTDC.cjs} +8 -8
- package/dist/{chunk-IXFNA5TT.js → chunk-YBIHSN55.js} +4 -4
- package/dist/{chunk-BLCWQ225.js → chunk-Z574GVI3.js} +4 -4
- package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
- package/dist/{chunk-VTFLKSJL.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
- package/dist/{chunk-KYJD2UMV.js → chunk-ZPHCTPR6.js} +4 -4
- package/dist/{chunk-VA7THINF.cjs → chunk-ZXXC2GXB.cjs} +38 -38
- package/dist/cli/holoscript-runner.cjs +168 -19
- package/dist/cli/holoscript-runner.js +162 -13
- package/dist/compiler/agent-inference.cjs +7 -7
- package/dist/compiler/agent-inference.js +3 -3
- package/dist/compiler/android-xr.cjs +6 -6
- package/dist/compiler/android-xr.js +4 -4
- package/dist/compiler/android.cjs +5 -5
- package/dist/compiler/android.js +3 -3
- package/dist/compiler/context.cjs +5 -5
- package/dist/compiler/context.js +2 -2
- package/dist/compiler/daimon-seed.cjs +8 -8
- package/dist/compiler/daimon-seed.js +3 -3
- package/dist/compiler/domain-block-utils.cjs +164 -164
- package/dist/compiler/domain-block-utils.js +3 -3
- package/dist/compiler/dtdl.cjs +6 -6
- package/dist/compiler/dtdl.js +3 -3
- package/dist/compiler/gltf-pipeline.cjs +8 -8
- package/dist/compiler/gltf-pipeline.js +1 -1
- package/dist/compiler/godot.cjs +5 -5
- package/dist/compiler/godot.js +4 -4
- package/dist/compiler/incremental.cjs +7 -7
- package/dist/compiler/incremental.js +2 -2
- package/dist/compiler/index.cjs +1603 -204
- package/dist/compiler/index.d.ts +8 -0
- package/dist/compiler/index.js +1431 -55
- package/dist/compiler/ios.cjs +5 -5
- package/dist/compiler/ios.js +3 -3
- package/dist/compiler/llm-provider-capabilities.cjs +5 -5
- package/dist/compiler/llm-provider-capabilities.js +2 -2
- package/dist/compiler/openxr.cjs +5 -5
- package/dist/compiler/openxr.js +4 -4
- package/dist/compiler/sdf.cjs +6 -6
- package/dist/compiler/sdf.js +4 -4
- package/dist/compiler/state.cjs +5 -5
- package/dist/compiler/state.js +3 -3
- package/dist/compiler/trait-composition.cjs +6 -6
- package/dist/compiler/trait-composition.js +2 -2
- package/dist/compiler/unity.cjs +5 -5
- package/dist/compiler/unity.js +4 -4
- package/dist/compiler/unreal.cjs +6 -6
- package/dist/compiler/unreal.js +4 -4
- package/dist/compiler/urdf.cjs +13 -13
- package/dist/compiler/urdf.js +4 -4
- package/dist/compiler/usd-physics.cjs +6 -6
- package/dist/compiler/usd-physics.js +3 -3
- package/dist/compiler/visionos.cjs +5 -5
- package/dist/compiler/visionos.js +4 -4
- package/dist/compiler/vrchat.cjs +6 -6
- package/dist/compiler/vrchat.js +4 -4
- package/dist/compiler/wasm.cjs +9 -9
- package/dist/compiler/wasm.js +4 -4
- package/dist/compiler/webgpu.cjs +5 -5
- package/dist/compiler/webgpu.js +4 -4
- package/dist/constants.cjs +99 -99
- package/dist/constants.js +3 -3
- package/dist/debugger.cjs +5 -5
- package/dist/debugger.js +3 -3
- package/dist/{dist-GRMOP2UL.cjs → dist-YGATNURH.cjs} +705 -9
- package/dist/{dist-ZBUKU2JG.js → dist-ZEZXRCBG.js} +701 -10
- package/dist/entries/scripting.cjs +8 -8
- package/dist/entries/scripting.js +4 -4
- package/dist/evolution/index.cjs +20 -20
- package/dist/evolution/index.js +8 -8
- package/dist/index.cjs +871 -809
- package/dist/index.d.ts +8 -0
- package/dist/index.js +132 -70
- package/dist/parser/HoloCompositionTypes.d.ts +1 -1
- package/dist/parser.cjs +21 -21
- package/dist/parser.js +7 -7
- package/dist/reconstruction/index.cjs +63 -63
- package/dist/reconstruction/index.js +7 -7
- package/dist/runtime.cjs +9 -9
- package/dist/runtime.js +3 -3
- package/dist/traits/botanical-lotus.d.ts +61 -0
- package/dist/traits/index.cjs +664 -671
- package/dist/traits/index.d.ts +65 -0
- package/dist/traits/index.js +14 -21
- package/dist/types/HoloScriptPlus.d.ts +1 -1
- package/package.json +65 -63
- package/dist/HoloCompositionParser-ZVRYVEA5.cjs +0 -45
- package/dist/HoloScriptPlusParser-WTPRPRPR.cjs +0 -30
- package/dist/HoloScriptPlusParser-ZP53ECSL.js +0 -13
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
|
|
4
4
|
|
|
5
5
|
// src/compiler/QuantumCircuitCompiler.ts
|
|
6
|
-
|
|
6
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
7
|
+
function configValue(entry) {
|
|
8
|
+
if (typeof entry === "object" && entry !== null && "value" in entry) {
|
|
9
|
+
return entry.value;
|
|
10
|
+
}
|
|
11
|
+
return entry;
|
|
12
|
+
}
|
|
7
13
|
function qubitsForMolecule(atoms) {
|
|
8
14
|
const orbitalCount = atoms.reduce((sum, a) => {
|
|
9
15
|
if (a.symbol === "H") return sum + 1;
|
|
@@ -14,8 +20,8 @@ function qubitsForMolecule(atoms) {
|
|
|
14
20
|
}
|
|
15
21
|
function extractNumber(config, key) {
|
|
16
22
|
const entry = config[key];
|
|
17
|
-
if (
|
|
18
|
-
const v = entry
|
|
23
|
+
if (entry === void 0) return void 0;
|
|
24
|
+
const v = configValue(entry);
|
|
19
25
|
if (typeof v === "number") return v;
|
|
20
26
|
if (typeof v === "string") {
|
|
21
27
|
const n = parseFloat(v);
|
|
@@ -23,10 +29,33 @@ function extractNumber(config, key) {
|
|
|
23
29
|
}
|
|
24
30
|
return void 0;
|
|
25
31
|
}
|
|
32
|
+
function extractString(config, ...keys) {
|
|
33
|
+
for (const key of keys) {
|
|
34
|
+
const value = configValue(config[key]);
|
|
35
|
+
if (typeof value === "string" && value.trim().length > 0) return value.trim();
|
|
36
|
+
}
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
function extractNumberArray(config, ...keys) {
|
|
40
|
+
for (const key of keys) {
|
|
41
|
+
let value = configValue(config[key]);
|
|
42
|
+
if (typeof value === "string") {
|
|
43
|
+
try {
|
|
44
|
+
value = JSON.parse(value);
|
|
45
|
+
} catch {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(value) && value.every((entry) => typeof entry === "number" && Number.isFinite(entry))) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
26
55
|
function extractAtoms(config) {
|
|
27
56
|
const entry = config["molecule"] ?? config["atoms"];
|
|
28
57
|
if (!entry) return void 0;
|
|
29
|
-
let raw = entry
|
|
58
|
+
let raw = configValue(entry);
|
|
30
59
|
if (typeof raw === "string") {
|
|
31
60
|
try {
|
|
32
61
|
raw = JSON.parse(raw);
|
|
@@ -40,9 +69,9 @@ function extractAtoms(config) {
|
|
|
40
69
|
);
|
|
41
70
|
}
|
|
42
71
|
function extractWeightMatrix(config) {
|
|
43
|
-
const entry = config["weightMatrix"] ?? config["weight_matrix"] ?? config["adjacency"];
|
|
72
|
+
const entry = config["quboMatrix"] ?? config["qubo_matrix"] ?? config["weightMatrix"] ?? config["weight_matrix"] ?? config["adjacency"];
|
|
44
73
|
if (!entry) return void 0;
|
|
45
|
-
let raw = entry
|
|
74
|
+
let raw = configValue(entry);
|
|
46
75
|
if (typeof raw === "string") {
|
|
47
76
|
try {
|
|
48
77
|
raw = JSON.parse(raw);
|
|
@@ -107,7 +136,7 @@ function generateVQECircuit(atoms, moleculeName, ansatzLayers, initialParams) {
|
|
|
107
136
|
const estimatedDepth = ansatzLayers * 2 + 1;
|
|
108
137
|
return { qasm: lines.join("\n"), numQubits: n, estimatedDepth, warnings, paramNames };
|
|
109
138
|
}
|
|
110
|
-
function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
139
|
+
function generateQAOACircuit(weightMatrix, p, optimizationProblem, initialGamma, initialBeta) {
|
|
111
140
|
const warnings = [];
|
|
112
141
|
let n = weightMatrix.length;
|
|
113
142
|
if (n > 100) {
|
|
@@ -132,7 +161,9 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
132
161
|
const lines = [];
|
|
133
162
|
lines.push("OPENQASM 3.0;");
|
|
134
163
|
lines.push('include "stdgates.inc";');
|
|
135
|
-
lines.push(
|
|
164
|
+
lines.push(
|
|
165
|
+
`// QAOA ${optimizationProblem === "qubo" ? "upper-triangular QUBO" : "Max-Cut"} circuit for ${n} binary variables (p=${p})`
|
|
166
|
+
);
|
|
136
167
|
lines.push("// Generated by HoloScript QuantumCircuitCompiler");
|
|
137
168
|
lines.push(`qubit[${n}] q;`);
|
|
138
169
|
lines.push(`bit[${n}] c;`);
|
|
@@ -147,16 +178,36 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
147
178
|
}
|
|
148
179
|
for (let round = 0; round < p; round++) {
|
|
149
180
|
lines.push(`// Problem unitary - round ${round + 1} (gamma=gamma_${round})`);
|
|
150
|
-
|
|
151
|
-
for (let
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
lines.push(`//
|
|
181
|
+
if (optimizationProblem === "qubo") {
|
|
182
|
+
for (let i = 0; i < n; i++) {
|
|
183
|
+
const qii = weightMatrix[i]?.[i] ?? 0;
|
|
184
|
+
if (qii !== 0) {
|
|
185
|
+
lines.push(`// QUBO linear x_${i} coefficient=${qii}`);
|
|
186
|
+
lines.push(`rz(-1.0 * gamma_${round} * ${qii.toFixed(4)}) q[${i}];`);
|
|
187
|
+
}
|
|
188
|
+
for (let j = i + 1; j < n; j++) {
|
|
189
|
+
const qij = weightMatrix[i]?.[j] ?? 0;
|
|
190
|
+
if (qij === 0) continue;
|
|
191
|
+
lines.push(`// QUBO pair x_${i}*x_${j} coefficient=${qij}`);
|
|
192
|
+
lines.push(`rz(-0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${i}];`);
|
|
193
|
+
lines.push(`rz(-0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${j}];`);
|
|
155
194
|
lines.push(`cx q[${i}], q[${j}];`);
|
|
156
|
-
lines.push(`rz(
|
|
195
|
+
lines.push(`rz(0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${j}];`);
|
|
157
196
|
lines.push(`cx q[${i}], q[${j}];`);
|
|
158
197
|
}
|
|
159
198
|
}
|
|
199
|
+
} else {
|
|
200
|
+
for (let i = 0; i < n; i++) {
|
|
201
|
+
for (let j = i + 1; j < n; j++) {
|
|
202
|
+
const w = weightMatrix[i]?.[j] ?? 0;
|
|
203
|
+
if (w !== 0) {
|
|
204
|
+
lines.push(`// Edge (${i},${j}) weight=${w}: rzz(2.0*gamma_${round}*${w.toFixed(4)})`);
|
|
205
|
+
lines.push(`cx q[${i}], q[${j}];`);
|
|
206
|
+
lines.push(`rz(2.0 * gamma_${round} * ${w.toFixed(4)}) q[${j}];`);
|
|
207
|
+
lines.push(`cx q[${i}], q[${j}];`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
160
211
|
}
|
|
161
212
|
lines.push(`// Mixer unitary - round ${round + 1} (beta=beta_${round})`);
|
|
162
213
|
for (let i = 0; i < n; i++) {
|
|
@@ -165,8 +216,11 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
165
216
|
}
|
|
166
217
|
lines.push("// Measurement");
|
|
167
218
|
lines.push("c = measure q;");
|
|
168
|
-
const
|
|
169
|
-
|
|
219
|
+
const termCount = weightMatrix.reduce(
|
|
220
|
+
(count, row, i) => count + row.slice(optimizationProblem === "qubo" ? i : i + 1).filter((w) => w !== 0).length,
|
|
221
|
+
0
|
|
222
|
+
);
|
|
223
|
+
const estimatedDepth = 1 + p * (Math.ceil(termCount * (optimizationProblem === "qubo" ? 5 : 3)) + 1) + 1;
|
|
170
224
|
return { qasm: lines.join("\n"), numQubits: n, estimatedDepth, warnings, paramNames };
|
|
171
225
|
}
|
|
172
226
|
function generateStubCircuit() {
|
|
@@ -183,11 +237,11 @@ function generateStubCircuit() {
|
|
|
183
237
|
return {
|
|
184
238
|
qasm,
|
|
185
239
|
warnings: [
|
|
186
|
-
"No @quantumCircuit (or @quantum_circuit) trait found in the composition. A stub 1-qubit circuit has been emitted. Add a @
|
|
240
|
+
"No @quantumCircuit (or @quantum_circuit) trait found in the composition. A stub 1-qubit circuit has been emitted. Add a @quantum_circuit trait with `molecule`, `weightMatrix`, or `quboMatrix` params to generate a real circuit."
|
|
187
241
|
]
|
|
188
242
|
};
|
|
189
243
|
}
|
|
190
|
-
var QuantumCircuitCompiler = class extends
|
|
244
|
+
var QuantumCircuitCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
191
245
|
constructor() {
|
|
192
246
|
super(...arguments);
|
|
193
247
|
this.compilerName = "QuantumCircuitCompiler";
|
|
@@ -199,6 +253,7 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
199
253
|
* `@quantumCircuit` or `@quantum_circuit` trait. Trait params drive the type:
|
|
200
254
|
* - `molecule` (or `atoms`) - VQE hardware-efficient ansatz
|
|
201
255
|
* - `weightMatrix` / `weight_matrix` / `adjacency` / `numNodes` - QAOA Max-Cut
|
|
256
|
+
* - `quboMatrix` / `qubo_matrix` - QAOA upper-triangular QUBO minimization
|
|
202
257
|
* - none of the above - stub 1-qubit circuit with a warning
|
|
203
258
|
*
|
|
204
259
|
* @param composition - Parsed HoloScript AST
|
|
@@ -226,12 +281,20 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
226
281
|
const cfg = trait.config;
|
|
227
282
|
const atoms = extractAtoms(cfg);
|
|
228
283
|
const weightMatrix = extractWeightMatrix(cfg);
|
|
284
|
+
const requestedProblem = extractString(
|
|
285
|
+
cfg,
|
|
286
|
+
"problemType",
|
|
287
|
+
"problem_type",
|
|
288
|
+
"optimizationProblem"
|
|
289
|
+
);
|
|
290
|
+
const hasExplicitQuboMatrix = cfg["quboMatrix"] !== void 0 || cfg["qubo_matrix"] !== void 0;
|
|
291
|
+
const optimizationProblem = requestedProblem?.toLowerCase() === "qubo" || hasExplicitQuboMatrix ? "qubo" : "maxcut";
|
|
229
292
|
const numNodes = extractNumber(cfg, "numNodes") ?? extractNumber(cfg, "num_nodes");
|
|
230
293
|
if (atoms && atoms.length > 0) {
|
|
231
294
|
return this.buildVQEOutput(atoms, cfg);
|
|
232
295
|
}
|
|
233
296
|
if (weightMatrix) {
|
|
234
|
-
return this.buildQAOAOutput(weightMatrix, cfg);
|
|
297
|
+
return this.buildQAOAOutput(weightMatrix, cfg, optimizationProblem);
|
|
235
298
|
}
|
|
236
299
|
if (numNodes !== void 0 && numNodes > 0) {
|
|
237
300
|
const n = Math.min(Math.round(numNodes), 100);
|
|
@@ -239,11 +302,11 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
239
302
|
{ length: n },
|
|
240
303
|
(_, i) => Array.from({ length: n }, (_2, j) => i !== j ? 1 : 0)
|
|
241
304
|
);
|
|
242
|
-
return this.buildQAOAOutput(matrix, cfg);
|
|
305
|
+
return this.buildQAOAOutput(matrix, cfg, "maxcut");
|
|
243
306
|
}
|
|
244
307
|
const { qasm, warnings } = generateStubCircuit();
|
|
245
308
|
warnings.unshift(
|
|
246
|
-
"@quantumCircuit trait found but neither `molecule`/`atoms
|
|
309
|
+
"@quantumCircuit trait found but neither `molecule`/`atoms`, `weightMatrix`/`numNodes`, nor `quboMatrix` params are present. Add params to generate a circuit."
|
|
247
310
|
);
|
|
248
311
|
return {
|
|
249
312
|
qasm,
|
|
@@ -278,12 +341,12 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
278
341
|
}
|
|
279
342
|
/** Build a {@link QASMOutput} for a VQE circuit. */
|
|
280
343
|
buildVQEOutput(atoms, cfg) {
|
|
281
|
-
const moleculeName = (
|
|
344
|
+
const moleculeName = extractString(cfg, "moleculeName", "molecule_name") ?? atoms.map((a) => a.symbol).join("") ?? "molecule";
|
|
282
345
|
const ansatzLayers = Math.max(
|
|
283
346
|
1,
|
|
284
347
|
Math.round(extractNumber(cfg, "ansatzLayers") ?? extractNumber(cfg, "ansatz_layers") ?? 2)
|
|
285
348
|
);
|
|
286
|
-
const initialParams = cfg
|
|
349
|
+
const initialParams = extractNumberArray(cfg, "initialParams", "initial_params");
|
|
287
350
|
const { qasm, numQubits, estimatedDepth, warnings, paramNames } = generateVQECircuit(
|
|
288
351
|
atoms,
|
|
289
352
|
moleculeName,
|
|
@@ -303,13 +366,14 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
303
366
|
};
|
|
304
367
|
}
|
|
305
368
|
/** Build a {@link QASMOutput} for a QAOA circuit. */
|
|
306
|
-
buildQAOAOutput(weightMatrix, cfg) {
|
|
369
|
+
buildQAOAOutput(weightMatrix, cfg, optimizationProblem) {
|
|
307
370
|
const p = Math.max(1, Math.round(extractNumber(cfg, "p") ?? 1));
|
|
308
371
|
const initialGamma = extractNumber(cfg, "gamma") ?? extractNumber(cfg, "initial_gamma");
|
|
309
372
|
const initialBeta = extractNumber(cfg, "beta") ?? extractNumber(cfg, "initial_beta");
|
|
310
373
|
const { qasm, numQubits, estimatedDepth, warnings, paramNames } = generateQAOACircuit(
|
|
311
374
|
weightMatrix,
|
|
312
375
|
p,
|
|
376
|
+
optimizationProblem,
|
|
313
377
|
initialGamma,
|
|
314
378
|
initialBeta
|
|
315
379
|
);
|
|
@@ -320,6 +384,7 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
320
384
|
estimatedDepth,
|
|
321
385
|
circuitType: "qaoa",
|
|
322
386
|
weightMatrix,
|
|
387
|
+
optimizationProblem,
|
|
323
388
|
recommendedBackend: numQubits <= 50 ? "aer" : "ibm-quantum",
|
|
324
389
|
warnings,
|
|
325
390
|
paramNames
|
|
@@ -328,5 +393,5 @@ var QuantumCircuitCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
|
|
|
328
393
|
};
|
|
329
394
|
|
|
330
395
|
exports.QuantumCircuitCompiler = QuantumCircuitCompiler;
|
|
331
|
-
//# sourceMappingURL=chunk-
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
396
|
+
//# sourceMappingURL=chunk-IPBSNGAN.cjs.map
|
|
397
|
+
//# sourceMappingURL=chunk-IPBSNGAN.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parsePipeline } from './chunk-SYTRBGDS.js';
|
|
2
|
-
import { ErrorRecovery } from './chunk-
|
|
2
|
+
import { ErrorRecovery } from './chunk-MSZNGI5P.js';
|
|
3
3
|
|
|
4
4
|
// src/parser/TypoDetector.ts
|
|
5
5
|
var TypoDetector = class {
|
|
@@ -7875,5 +7875,5 @@ function parseHoloPartial(source, options) {
|
|
|
7875
7875
|
}
|
|
7876
7876
|
|
|
7877
7877
|
export { HoloCompositionParser, KEYWORDS, LIGHT_PRIMITIVES, PRIMITIVE_SHAPES, parseHolo, parseHoloPartial, parseHoloStrict };
|
|
7878
|
-
//# sourceMappingURL=chunk-
|
|
7879
|
-
//# sourceMappingURL=chunk-
|
|
7878
|
+
//# sourceMappingURL=chunk-IX2U3RQT.js.map
|
|
7879
|
+
//# sourceMappingURL=chunk-IX2U3RQT.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkVHORVGCG_cjs = require('./chunk-VHORVGCG.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
|
|
5
5
|
var chunkZHPMP447_cjs = require('./chunk-ZHPMP447.cjs');
|
|
6
6
|
|
|
7
7
|
// src/compiler/DomainBlockCompilerMixin.ts
|
|
8
8
|
function esc(value, target) {
|
|
9
|
-
return
|
|
9
|
+
return chunkCMEINO5I_cjs.escapeStringValue(value, target);
|
|
10
10
|
}
|
|
11
11
|
function isPhysicalMaterial(mat) {
|
|
12
12
|
return PHYSICAL_MATERIAL_KEYS.some((k) => mat[k] !== void 0);
|
|
@@ -4647,13 +4647,13 @@ function hexToRGBA(hex, alpha) {
|
|
|
4647
4647
|
];
|
|
4648
4648
|
}
|
|
4649
4649
|
function getRequiredCapability() {
|
|
4650
|
-
return
|
|
4650
|
+
return chunkCMEINO5I_cjs.ANSCapabilityPath.DOMAIN_BLOCK;
|
|
4651
4651
|
}
|
|
4652
4652
|
var PHYSICAL_MATERIAL_KEYS, mgToVec3, mgToF32; exports.DOMAIN_BLOCK_COMPILER_MIXIN_CAPABILITY = void 0;
|
|
4653
4653
|
var init_DomainBlockCompilerMixin = chunkZHPMP447_cjs.__esm({
|
|
4654
4654
|
"src/compiler/DomainBlockCompilerMixin.ts"() {
|
|
4655
|
-
|
|
4656
|
-
|
|
4655
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
4656
|
+
chunkCMEINO5I_cjs.init_ANSNamespace();
|
|
4657
4657
|
chunkVHORVGCG_cjs.init_PerceptualColorPass();
|
|
4658
4658
|
PHYSICAL_MATERIAL_KEYS = [
|
|
4659
4659
|
"clearcoat",
|
|
@@ -4835,5 +4835,5 @@ exports.web3ToR3F = web3ToR3F;
|
|
|
4835
4835
|
exports.web3ToUSDA = web3ToUSDA;
|
|
4836
4836
|
exports.web3ToUnity = web3ToUnity;
|
|
4837
4837
|
exports.web3ToVRChat = web3ToVRChat;
|
|
4838
|
-
//# sourceMappingURL=chunk-
|
|
4839
|
-
//# sourceMappingURL=chunk-
|
|
4838
|
+
//# sourceMappingURL=chunk-IYK6LMQ7.cjs.map
|
|
4839
|
+
//# sourceMappingURL=chunk-IYK6LMQ7.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseHolo } from './chunk-
|
|
2
|
-
import { parse } from './chunk-
|
|
1
|
+
import { parseHolo } from './chunk-IX2U3RQT.js';
|
|
2
|
+
import { parse } from './chunk-F33KLYOS.js';
|
|
3
3
|
|
|
4
4
|
// src/evolution/EvolveProgramBackend.ts
|
|
5
5
|
async function sha256Hex(s) {
|
|
@@ -594,5 +594,5 @@ function makeWasmCompilerFitnessGate(compileCandidate, opts = {}) {
|
|
|
594
594
|
}
|
|
595
595
|
|
|
596
596
|
export { CORPUS_PORTFOLIO, accrueOneStep, dedupRows, extractStateMachine, makeOllamaProposer, makeOpenAICompatibleProposer, makeSeedGate, makeWasmCompilerFitnessGate, parsesClean, runEvolution, scoreWasmCompilerArtifact, stateMachineSemanticCheck, stateMachineWellFormed, toGradedTraceRow, wasmFitnessBaselineFromScenario };
|
|
597
|
-
//# sourceMappingURL=chunk-
|
|
598
|
-
//# sourceMappingURL=chunk-
|
|
597
|
+
//# sourceMappingURL=chunk-J3VVM6GV.js.map
|
|
598
|
+
//# sourceMappingURL=chunk-J3VVM6GV.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTZCFKZ6Z_cjs = require('./chunk-TZCFKZ6Z.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkIYK6LMQ7_cjs = require('./chunk-IYK6LMQ7.cjs');
|
|
5
|
+
var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
|
|
6
6
|
var chunkZHPMP447_cjs = require('./chunk-ZHPMP447.cjs');
|
|
7
7
|
var ans = require('@holoscript/core-types/ans');
|
|
8
8
|
|
|
@@ -1699,10 +1699,10 @@ exports.VisionOSCompiler = void 0;
|
|
|
1699
1699
|
var init_VisionOSCompiler = chunkZHPMP447_cjs.__esm({
|
|
1700
1700
|
"src/compiler/VisionOSCompiler.ts"() {
|
|
1701
1701
|
init_VisionOSTraitMap();
|
|
1702
|
-
|
|
1702
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
1703
1703
|
chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
|
|
1704
|
-
|
|
1705
|
-
exports.VisionOSCompiler = class extends
|
|
1704
|
+
chunkIYK6LMQ7_cjs.init_DomainBlockCompilerMixin();
|
|
1705
|
+
exports.VisionOSCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
1706
1706
|
constructor(options = {}) {
|
|
1707
1707
|
super();
|
|
1708
1708
|
this.compilerName = "VisionOSCompiler";
|
|
@@ -1856,31 +1856,31 @@ var init_VisionOSCompiler = chunkZHPMP447_cjs.__esm({
|
|
|
1856
1856
|
this.emit("");
|
|
1857
1857
|
this.emit("// === v4.2 Domain Blocks ===");
|
|
1858
1858
|
let blockIdx = 0;
|
|
1859
|
-
const compiled =
|
|
1859
|
+
const compiled = chunkIYK6LMQ7_cjs.compileDomainBlocks(
|
|
1860
1860
|
domainBlocks,
|
|
1861
1861
|
{
|
|
1862
1862
|
material: (block) => {
|
|
1863
|
-
const mat =
|
|
1864
|
-
return
|
|
1863
|
+
const mat = chunkIYK6LMQ7_cjs.compileMaterialBlock(block);
|
|
1864
|
+
return chunkIYK6LMQ7_cjs.materialToVisionOS(mat, `db${blockIdx++}`);
|
|
1865
1865
|
},
|
|
1866
1866
|
physics: (block) => {
|
|
1867
|
-
const phys =
|
|
1868
|
-
return
|
|
1867
|
+
const phys = chunkIYK6LMQ7_cjs.compilePhysicsBlock(block);
|
|
1868
|
+
return chunkIYK6LMQ7_cjs.physicsToVisionOS(phys, `db${blockIdx++}`);
|
|
1869
1869
|
},
|
|
1870
1870
|
vfx: (block) => {
|
|
1871
|
-
const ps =
|
|
1872
|
-
return
|
|
1871
|
+
const ps = chunkIYK6LMQ7_cjs.compileParticleBlock(block);
|
|
1872
|
+
return chunkIYK6LMQ7_cjs.particlesToVisionOS(ps, `db${blockIdx++}`);
|
|
1873
1873
|
},
|
|
1874
1874
|
postfx: (block) => {
|
|
1875
|
-
const pp =
|
|
1875
|
+
const pp = chunkIYK6LMQ7_cjs.compilePostProcessingBlock(block);
|
|
1876
1876
|
return `// Post-Processing: ${pp.keyword} \u2014 configure via RealityKit RenderCallbacks`;
|
|
1877
1877
|
},
|
|
1878
1878
|
audio: (block) => {
|
|
1879
|
-
const audio =
|
|
1880
|
-
return
|
|
1879
|
+
const audio = chunkIYK6LMQ7_cjs.compileAudioSourceBlock(block);
|
|
1880
|
+
return chunkIYK6LMQ7_cjs.audioSourceToVisionOS(audio, `db${blockIdx++}`);
|
|
1881
1881
|
},
|
|
1882
1882
|
weather: (block) => {
|
|
1883
|
-
const weather =
|
|
1883
|
+
const weather = chunkIYK6LMQ7_cjs.compileWeatherBlock(block);
|
|
1884
1884
|
const w = weather;
|
|
1885
1885
|
const layers = w.layers.map((l) => `// Layer: ${l.type} \u2014 ${JSON.stringify(l.properties)}`).join("\n");
|
|
1886
1886
|
return `// Weather: ${w.keyword} "${w.name || ""}" \u2014 implement via custom RealityKit particles
|
|
@@ -2796,5 +2796,5 @@ exports.getTraitMapping = getTraitMapping;
|
|
|
2796
2796
|
exports.init_VisionOSCompiler = init_VisionOSCompiler;
|
|
2797
2797
|
exports.init_VisionOSTraitMap = init_VisionOSTraitMap;
|
|
2798
2798
|
exports.listAllTraits = listAllTraits;
|
|
2799
|
-
//# sourceMappingURL=chunk-
|
|
2800
|
-
//# sourceMappingURL=chunk-
|
|
2799
|
+
//# sourceMappingURL=chunk-J74S4ZMF.cjs.map
|
|
2800
|
+
//# sourceMappingURL=chunk-J74S4ZMF.cjs.map
|
|
@@ -3031,6 +3031,8 @@ var init_security_crypto = chunkZHPMP447_cjs.__esm({
|
|
|
3031
3031
|
"chain_of_trust",
|
|
3032
3032
|
"detached_signature",
|
|
3033
3033
|
"embedded_signature",
|
|
3034
|
+
"decode_receipt",
|
|
3035
|
+
// SHA-256 hash-chained QEC decode receipt (qec-decode-receipt/v0); extends Paper 37 Quantum Receipt Chain
|
|
3034
3036
|
// Zero-Knowledge Proofs
|
|
3035
3037
|
"zero_knowledge_proof",
|
|
3036
3038
|
"zk_snark",
|
|
@@ -3253,5 +3255,5 @@ exports.init_weather_particles = init_weather_particles;
|
|
|
3253
3255
|
exports.init_weather_phenomena = init_weather_phenomena;
|
|
3254
3256
|
exports.init_xr_platform = init_xr_platform;
|
|
3255
3257
|
exports.isReconstructionDecorator = isReconstructionDecorator;
|
|
3256
|
-
//# sourceMappingURL=chunk-
|
|
3257
|
-
//# sourceMappingURL=chunk-
|
|
3258
|
+
//# sourceMappingURL=chunk-JERWCCEJ.cjs.map
|
|
3259
|
+
//# sourceMappingURL=chunk-JERWCCEJ.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computeContentHash } from './chunk-4R6SBXDB.js';
|
|
2
|
-
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-
|
|
2
|
+
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-QC3CAVFN.js';
|
|
3
3
|
import { init_safeJsonParse, readJson } from './chunk-RAN3ECAS.js';
|
|
4
4
|
import { createHash } from 'crypto';
|
|
5
5
|
|
|
@@ -725,7 +725,7 @@ var ImportResolver = class {
|
|
|
725
725
|
throw new Error(`File not found: '${canonicalPath}' (imported from '${importedBy}')`);
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
const { HoloScriptPlusParser } = await import('./HoloScriptPlusParser-
|
|
728
|
+
const { HoloScriptPlusParser } = await import('./HoloScriptPlusParser-YCV6L7GI.js');
|
|
729
729
|
const parser = new HoloScriptPlusParser({ enableTypeScriptImports: true });
|
|
730
730
|
const result = parser.parse(source);
|
|
731
731
|
if (!result.success && result.errors.length > 0) {
|
|
@@ -2003,5 +2003,5 @@ var UnauthorizedIncrementalCompilerAccessError = class extends UnauthorizedCompi
|
|
|
2003
2003
|
};
|
|
2004
2004
|
|
|
2005
2005
|
export { IncrementalCompiler, TraitDependencyGraph, UnauthorizedIncrementalCompilerAccessError, createIncrementalCompiler, deserializeCache, globalTraitGraph, serializeCache };
|
|
2006
|
-
//# sourceMappingURL=chunk-
|
|
2007
|
-
//# sourceMappingURL=chunk-
|
|
2006
|
+
//# sourceMappingURL=chunk-JTDDLCSP.js.map
|
|
2007
|
+
//# sourceMappingURL=chunk-JTDDLCSP.js.map
|