@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.
Files changed (187) hide show
  1. package/README.md +6 -13
  2. package/bin/holo-decision.mjs +0 -0
  3. package/bin/holoscript.cjs +0 -0
  4. package/dist/{GLTFPipeline-6LS3UDYX.js → GLTFPipeline-FRBZIATS.js} +6 -6
  5. package/dist/{GLTFPipeline-VTI6PRRQ.cjs → GLTFPipeline-MTPP444P.cjs} +10 -10
  6. package/dist/{HoloCompositionParser-GILABNN3.js → HoloCompositionParser-2GVQAZ2X.js} +7 -7
  7. package/dist/HoloCompositionParser-3NDF6BMX.cjs +45 -0
  8. package/dist/HoloScriptPlusParser-URSIBEAW.cjs +30 -0
  9. package/dist/HoloScriptPlusParser-YCV6L7GI.js +13 -0
  10. package/dist/{HoloScriptRuntime-YBYXJHJN.cjs → HoloScriptRuntime-CRWI6C3P.cjs} +5 -5
  11. package/dist/{HoloScriptRuntime-UTRLJI5L.js → HoloScriptRuntime-IAZGHPFP.js} +4 -4
  12. package/dist/{SceneIRCompiler-VX75RB6H.js → SceneIRCompiler-BJQMKLWL.js} +6 -6
  13. package/dist/{SceneIRCompiler-7KQ5NKAU.cjs → SceneIRCompiler-RTPPDQAV.cjs} +11 -11
  14. package/dist/{chunk-Y2OCKXVD.js → chunk-22AULOAL.js} +5 -5
  15. package/dist/{chunk-D44CEFY4.cjs → chunk-2DJIS7TH.cjs} +5 -5
  16. package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
  17. package/dist/{chunk-M7XR3F53.js → chunk-2UP2J3OK.js} +4 -4
  18. package/dist/{chunk-3KHRZTNW.js → chunk-3AUYBQ5I.js} +3 -3
  19. package/dist/{chunk-UKEK2NZJ.js → chunk-3MQAOMKD.js} +3 -3
  20. package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
  21. package/dist/{chunk-7ITJP33Q.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
  22. package/dist/{chunk-47XZ62KM.js → chunk-4UA5OBWR.js} +5 -5
  23. package/dist/{chunk-ORBVCOTC.js → chunk-5LCJDX5A.js} +3 -3
  24. package/dist/{chunk-IK6Z2HNC.js → chunk-6OQHLNTT.js} +2 -2
  25. package/dist/{chunk-EI3J6LTW.cjs → chunk-6RDHWSZM.cjs} +217 -217
  26. package/dist/{chunk-73EDVY5D.js → chunk-7AY66PZP.js} +3 -3
  27. package/dist/{chunk-6FCNMTL5.js → chunk-7HDRN5BW.js} +4 -4
  28. package/dist/{chunk-N7MIIDLI.cjs → chunk-7IBXTJP7.cjs} +8 -8
  29. package/dist/{chunk-R5VKLUMR.js → chunk-AAUQTR7I.js} +4 -4
  30. package/dist/{chunk-HCONR4J6.cjs → chunk-AN3ZH7M7.cjs} +38 -38
  31. package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
  32. package/dist/{chunk-W4AJMMQR.js → chunk-AUF7HFOO.js} +60 -22
  33. package/dist/{chunk-SKVBUGMC.cjs → chunk-AUMTQV64.cjs} +7 -7
  34. package/dist/{chunk-7ZKQ32XK.js → chunk-B5K3WHJ4.js} +4 -4
  35. package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
  36. package/dist/{chunk-SE2Y5BSL.cjs → chunk-CMEINO5I.cjs} +186 -70
  37. package/dist/{chunk-YMI3ED3B.cjs → chunk-CRUIGXF7.cjs} +5 -5
  38. package/dist/chunk-DDBYJJZK.js +1571 -0
  39. package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
  40. package/dist/{chunk-GI5YYZH6.js → chunk-E4YS5SIZ.js} +90 -25
  41. package/dist/{chunk-62OYZT6Q.js → chunk-EKNWUSGW.js} +3 -3
  42. package/dist/{chunk-RVN7OPCP.js → chunk-ETIJOUIO.js} +4 -4
  43. package/dist/chunk-EUNELE7Y.cjs +1605 -0
  44. package/dist/{chunk-C73GVAYC.js → chunk-F33KLYOS.js} +5 -5
  45. package/dist/{chunk-4CRMVEON.cjs → chunk-F47FEV4X.cjs} +40 -40
  46. package/dist/{chunk-FGXJPJ3W.cjs → chunk-FCGTI7FO.cjs} +4 -4
  47. package/dist/{chunk-OSKGCXAQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
  48. package/dist/{chunk-XZC75AJ4.cjs → chunk-FPGYWNNA.cjs} +5 -5
  49. package/dist/{chunk-5B2AJKA5.cjs → chunk-FQ4MYZYU.cjs} +20 -20
  50. package/dist/{chunk-KOGPVAP6.js → chunk-FT4FGTR6.js} +3 -3
  51. package/dist/{chunk-N7IYRAFG.cjs → chunk-FVNV4WHQ.cjs} +14 -14
  52. package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
  53. package/dist/{chunk-TKDDIE3T.cjs → chunk-ILO2KMER.cjs} +4 -4
  54. package/dist/{chunk-GGH3ZYDB.cjs → chunk-IPBSNGAN.cjs} +92 -27
  55. package/dist/{chunk-JQCXLKAU.js → chunk-IX2U3RQT.js} +3 -3
  56. package/dist/{chunk-P65OIMJT.cjs → chunk-IYK6LMQ7.cjs} +7 -7
  57. package/dist/{chunk-NWKARJM2.js → chunk-J3VVM6GV.js} +4 -4
  58. package/dist/{chunk-FOM36K5I.cjs → chunk-J74S4ZMF.cjs} +18 -18
  59. package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
  60. package/dist/{chunk-VXHB6ZHY.js → chunk-JTDDLCSP.js} +4 -4
  61. package/dist/{chunk-GYJLP4BO.cjs → chunk-K53L47NH.cjs} +30 -30
  62. package/dist/{chunk-FHR2AVMA.cjs → chunk-LJTM5ONX.cjs} +23 -23
  63. package/dist/{chunk-JCVSCKUH.js → chunk-LJVVOVA6.js} +4 -4
  64. package/dist/{chunk-LQNL3IYV.cjs → chunk-LNJKBQ2B.cjs} +38 -38
  65. package/dist/{chunk-2GKF7JQ6.js → chunk-M2GDE3NV.js} +3 -3
  66. package/dist/{chunk-Z7NUL73U.js → chunk-MSZNGI5P.js} +3 -3
  67. package/dist/{chunk-B6JHTTMR.cjs → chunk-N2BOTBPG.cjs} +15 -15
  68. package/dist/{chunk-L4DBUX3N.cjs → chunk-NFALJJCH.cjs} +12 -12
  69. package/dist/{chunk-YBM34FUJ.cjs → chunk-NRZRBK25.cjs} +6 -6
  70. package/dist/{chunk-SNMQUWIO.cjs → chunk-NTSLNIY7.cjs} +10 -10
  71. package/dist/{chunk-645EWDZW.cjs → chunk-NZJOAWJM.cjs} +4 -4
  72. package/dist/{chunk-LGRKBTPM.js → chunk-OG7RKWWX.js} +3 -3
  73. package/dist/{chunk-OOP4S3GU.cjs → chunk-OQVHCYY4.cjs} +5 -5
  74. package/dist/{chunk-TMNAKNV2.cjs → chunk-PEBNX3VM.cjs} +5 -5
  75. package/dist/{chunk-5T6BWIB7.js → chunk-PFZ5WLIP.js} +4 -4
  76. package/dist/{chunk-CESMPUEZ.cjs → chunk-PHLNABJD.cjs} +159 -145
  77. package/dist/{chunk-CHIZSMWD.js → chunk-PLK3DLTF.js} +3 -3
  78. package/dist/{chunk-4NEPHK2K.js → chunk-PMACVMHL.js} +3 -3
  79. package/dist/{chunk-EYHPTJ3F.js → chunk-PV2OXNP5.js} +40 -26
  80. package/dist/{chunk-KLM6QD6D.cjs → chunk-Q6VW7MGX.cjs} +14 -14
  81. package/dist/{chunk-YDSNDCV3.js → chunk-QC3CAVFN.js} +186 -69
  82. package/dist/{chunk-REN3LHO6.cjs → chunk-QKLEDRHN.cjs} +19 -19
  83. package/dist/{chunk-2EGGAZT3.js → chunk-QS27OYBU.js} +3 -3
  84. package/dist/{chunk-4376VHNJ.js → chunk-RUB7WL6C.js} +3 -3
  85. package/dist/chunk-S2BSXG3B.js +3308 -0
  86. package/dist/{chunk-TZQKJOPC.js → chunk-TW2AH2ZS.js} +3 -3
  87. package/dist/{chunk-Q4J2K7FI.js → chunk-TZM6DKSJ.js} +6 -6
  88. package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
  89. package/dist/{chunk-ERYKKPHW.cjs → chunk-U6CQOM5Q.cjs} +13 -13
  90. package/dist/{chunk-VMCR5QVI.js → chunk-ULT2QAV5.js} +4 -4
  91. package/dist/chunk-VQOTDNFL.cjs +3337 -0
  92. package/dist/{chunk-VZI7S7P6.cjs → chunk-VSO6HPDZ.cjs} +7 -7
  93. package/dist/{chunk-QLPRI3QW.js → chunk-WQJMSSJT.js} +4 -4
  94. package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
  95. package/dist/{chunk-42Z3SVHQ.js → chunk-X5PMMK7H.js} +3 -3
  96. package/dist/{chunk-ML4V5PVU.cjs → chunk-X5ZLSPU2.cjs} +74 -32
  97. package/dist/{chunk-PSWCJQS4.js → chunk-X727CQ7X.js} +5 -5
  98. package/dist/{chunk-YM7UUYR5.cjs → chunk-XHZYS4QO.cjs} +5 -5
  99. package/dist/{chunk-PZ46WRHX.cjs → chunk-XRQCTTDC.cjs} +8 -8
  100. package/dist/{chunk-IXFNA5TT.js → chunk-YBIHSN55.js} +4 -4
  101. package/dist/{chunk-BLCWQ225.js → chunk-Z574GVI3.js} +4 -4
  102. package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
  103. package/dist/{chunk-VTFLKSJL.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
  104. package/dist/{chunk-KYJD2UMV.js → chunk-ZPHCTPR6.js} +4 -4
  105. package/dist/{chunk-VA7THINF.cjs → chunk-ZXXC2GXB.cjs} +38 -38
  106. package/dist/cli/holoscript-runner.cjs +168 -19
  107. package/dist/cli/holoscript-runner.js +162 -13
  108. package/dist/compiler/agent-inference.cjs +7 -7
  109. package/dist/compiler/agent-inference.js +3 -3
  110. package/dist/compiler/android-xr.cjs +6 -6
  111. package/dist/compiler/android-xr.js +4 -4
  112. package/dist/compiler/android.cjs +5 -5
  113. package/dist/compiler/android.js +3 -3
  114. package/dist/compiler/context.cjs +5 -5
  115. package/dist/compiler/context.js +2 -2
  116. package/dist/compiler/daimon-seed.cjs +8 -8
  117. package/dist/compiler/daimon-seed.js +3 -3
  118. package/dist/compiler/domain-block-utils.cjs +164 -164
  119. package/dist/compiler/domain-block-utils.js +3 -3
  120. package/dist/compiler/dtdl.cjs +6 -6
  121. package/dist/compiler/dtdl.js +3 -3
  122. package/dist/compiler/gltf-pipeline.cjs +8 -8
  123. package/dist/compiler/gltf-pipeline.js +1 -1
  124. package/dist/compiler/godot.cjs +5 -5
  125. package/dist/compiler/godot.js +4 -4
  126. package/dist/compiler/incremental.cjs +7 -7
  127. package/dist/compiler/incremental.js +2 -2
  128. package/dist/compiler/index.cjs +1603 -204
  129. package/dist/compiler/index.d.ts +8 -0
  130. package/dist/compiler/index.js +1431 -55
  131. package/dist/compiler/ios.cjs +5 -5
  132. package/dist/compiler/ios.js +3 -3
  133. package/dist/compiler/llm-provider-capabilities.cjs +5 -5
  134. package/dist/compiler/llm-provider-capabilities.js +2 -2
  135. package/dist/compiler/openxr.cjs +5 -5
  136. package/dist/compiler/openxr.js +4 -4
  137. package/dist/compiler/sdf.cjs +6 -6
  138. package/dist/compiler/sdf.js +4 -4
  139. package/dist/compiler/state.cjs +5 -5
  140. package/dist/compiler/state.js +3 -3
  141. package/dist/compiler/trait-composition.cjs +6 -6
  142. package/dist/compiler/trait-composition.js +2 -2
  143. package/dist/compiler/unity.cjs +5 -5
  144. package/dist/compiler/unity.js +4 -4
  145. package/dist/compiler/unreal.cjs +6 -6
  146. package/dist/compiler/unreal.js +4 -4
  147. package/dist/compiler/urdf.cjs +13 -13
  148. package/dist/compiler/urdf.js +4 -4
  149. package/dist/compiler/usd-physics.cjs +6 -6
  150. package/dist/compiler/usd-physics.js +3 -3
  151. package/dist/compiler/visionos.cjs +5 -5
  152. package/dist/compiler/visionos.js +4 -4
  153. package/dist/compiler/vrchat.cjs +6 -6
  154. package/dist/compiler/vrchat.js +4 -4
  155. package/dist/compiler/wasm.cjs +9 -9
  156. package/dist/compiler/wasm.js +4 -4
  157. package/dist/compiler/webgpu.cjs +5 -5
  158. package/dist/compiler/webgpu.js +4 -4
  159. package/dist/constants.cjs +99 -99
  160. package/dist/constants.js +3 -3
  161. package/dist/debugger.cjs +5 -5
  162. package/dist/debugger.js +3 -3
  163. package/dist/{dist-GRMOP2UL.cjs → dist-YGATNURH.cjs} +705 -9
  164. package/dist/{dist-ZBUKU2JG.js → dist-ZEZXRCBG.js} +701 -10
  165. package/dist/entries/scripting.cjs +8 -8
  166. package/dist/entries/scripting.js +4 -4
  167. package/dist/evolution/index.cjs +20 -20
  168. package/dist/evolution/index.js +8 -8
  169. package/dist/index.cjs +871 -809
  170. package/dist/index.d.ts +8 -0
  171. package/dist/index.js +132 -70
  172. package/dist/parser/HoloCompositionTypes.d.ts +1 -1
  173. package/dist/parser.cjs +21 -21
  174. package/dist/parser.js +7 -7
  175. package/dist/reconstruction/index.cjs +63 -63
  176. package/dist/reconstruction/index.js +7 -7
  177. package/dist/runtime.cjs +9 -9
  178. package/dist/runtime.js +3 -3
  179. package/dist/traits/botanical-lotus.d.ts +61 -0
  180. package/dist/traits/index.cjs +664 -671
  181. package/dist/traits/index.d.ts +65 -0
  182. package/dist/traits/index.js +14 -21
  183. package/dist/types/HoloScriptPlus.d.ts +1 -1
  184. package/package.json +65 -63
  185. package/dist/HoloCompositionParser-ZVRYVEA5.cjs +0 -45
  186. package/dist/HoloScriptPlusParser-WTPRPRPR.cjs +0 -30
  187. package/dist/HoloScriptPlusParser-ZP53ECSL.js +0 -13
@@ -1,9 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkSE2Y5BSL_cjs = require('./chunk-SE2Y5BSL.cjs');
3
+ var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
4
4
 
5
5
  // src/compiler/QuantumCircuitCompiler.ts
6
- chunkSE2Y5BSL_cjs.init_CompilerBase();
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 (!entry) return void 0;
18
- const v = entry.value;
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.value;
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.value;
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(`// QAOA Max-Cut circuit for ${n}-node graph (p=${p})`);
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
- for (let i = 0; i < n; i++) {
151
- for (let j = i + 1; j < n; j++) {
152
- const w = weightMatrix[i]?.[j] ?? 0;
153
- if (w !== 0) {
154
- lines.push(`// Edge (${i},${j}) weight=${w}: rzz(2.0*gamma_${round}*${w.toFixed(4)})`);
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(2.0 * gamma_${round} * ${w.toFixed(4)}) q[${j}];`);
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 edgeCount = weightMatrix.flat().filter((w) => w !== 0).length / 2;
169
- const estimatedDepth = 1 + p * (Math.ceil(edgeCount * 3) + 1) + 1;
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 @quantumCircuit trait with `molecule` or `weightMatrix` params to generate a real circuit."
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 chunkSE2Y5BSL_cjs.CompilerBase {
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` nor `weightMatrix`/`numNodes` params are present. Add params to generate a circuit."
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 = (extractNumber(cfg, "moleculeName") !== void 0 ? void 0 : cfg["moleculeName"]?.value) ?? atoms.map((a) => a.symbol).join("") ?? "molecule";
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["initialParams"]?.value ?? cfg["initial_params"]?.value ?? void 0;
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-GGH3ZYDB.cjs.map
332
- //# sourceMappingURL=chunk-GGH3ZYDB.cjs.map
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-Z7NUL73U.js';
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-JQCXLKAU.js.map
7879
- //# sourceMappingURL=chunk-JQCXLKAU.js.map
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 chunkSE2Y5BSL_cjs = require('./chunk-SE2Y5BSL.cjs');
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 chunkSE2Y5BSL_cjs.escapeStringValue(value, target);
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 chunkSE2Y5BSL_cjs.ANSCapabilityPath.DOMAIN_BLOCK;
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
- chunkSE2Y5BSL_cjs.init_CompilerBase();
4656
- chunkSE2Y5BSL_cjs.init_ANSNamespace();
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-P65OIMJT.cjs.map
4839
- //# sourceMappingURL=chunk-P65OIMJT.cjs.map
4838
+ //# sourceMappingURL=chunk-IYK6LMQ7.cjs.map
4839
+ //# sourceMappingURL=chunk-IYK6LMQ7.cjs.map
@@ -1,5 +1,5 @@
1
- import { parseHolo } from './chunk-JQCXLKAU.js';
2
- import { parse } from './chunk-C73GVAYC.js';
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-NWKARJM2.js.map
598
- //# sourceMappingURL=chunk-NWKARJM2.js.map
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 chunkP65OIMJT_cjs = require('./chunk-P65OIMJT.cjs');
5
- var chunkSE2Y5BSL_cjs = require('./chunk-SE2Y5BSL.cjs');
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
- chunkSE2Y5BSL_cjs.init_CompilerBase();
1702
+ chunkCMEINO5I_cjs.init_CompilerBase();
1703
1703
  chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
1704
- chunkP65OIMJT_cjs.init_DomainBlockCompilerMixin();
1705
- exports.VisionOSCompiler = class extends chunkSE2Y5BSL_cjs.CompilerBase {
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 = chunkP65OIMJT_cjs.compileDomainBlocks(
1859
+ const compiled = chunkIYK6LMQ7_cjs.compileDomainBlocks(
1860
1860
  domainBlocks,
1861
1861
  {
1862
1862
  material: (block) => {
1863
- const mat = chunkP65OIMJT_cjs.compileMaterialBlock(block);
1864
- return chunkP65OIMJT_cjs.materialToVisionOS(mat, `db${blockIdx++}`);
1863
+ const mat = chunkIYK6LMQ7_cjs.compileMaterialBlock(block);
1864
+ return chunkIYK6LMQ7_cjs.materialToVisionOS(mat, `db${blockIdx++}`);
1865
1865
  },
1866
1866
  physics: (block) => {
1867
- const phys = chunkP65OIMJT_cjs.compilePhysicsBlock(block);
1868
- return chunkP65OIMJT_cjs.physicsToVisionOS(phys, `db${blockIdx++}`);
1867
+ const phys = chunkIYK6LMQ7_cjs.compilePhysicsBlock(block);
1868
+ return chunkIYK6LMQ7_cjs.physicsToVisionOS(phys, `db${blockIdx++}`);
1869
1869
  },
1870
1870
  vfx: (block) => {
1871
- const ps = chunkP65OIMJT_cjs.compileParticleBlock(block);
1872
- return chunkP65OIMJT_cjs.particlesToVisionOS(ps, `db${blockIdx++}`);
1871
+ const ps = chunkIYK6LMQ7_cjs.compileParticleBlock(block);
1872
+ return chunkIYK6LMQ7_cjs.particlesToVisionOS(ps, `db${blockIdx++}`);
1873
1873
  },
1874
1874
  postfx: (block) => {
1875
- const pp = chunkP65OIMJT_cjs.compilePostProcessingBlock(block);
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 = chunkP65OIMJT_cjs.compileAudioSourceBlock(block);
1880
- return chunkP65OIMJT_cjs.audioSourceToVisionOS(audio, `db${blockIdx++}`);
1879
+ const audio = chunkIYK6LMQ7_cjs.compileAudioSourceBlock(block);
1880
+ return chunkIYK6LMQ7_cjs.audioSourceToVisionOS(audio, `db${blockIdx++}`);
1881
1881
  },
1882
1882
  weather: (block) => {
1883
- const weather = chunkP65OIMJT_cjs.compileWeatherBlock(block);
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-FOM36K5I.cjs.map
2800
- //# sourceMappingURL=chunk-FOM36K5I.cjs.map
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-36NPLOI4.cjs.map
3257
- //# sourceMappingURL=chunk-36NPLOI4.cjs.map
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-YDSNDCV3.js';
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-ZP53ECSL.js');
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-VXHB6ZHY.js.map
2007
- //# sourceMappingURL=chunk-VXHB6ZHY.js.map
2006
+ //# sourceMappingURL=chunk-JTDDLCSP.js.map
2007
+ //# sourceMappingURL=chunk-JTDDLCSP.js.map