You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/challenge_suite/problem_7.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ The evaluator defines and passes the following configuration dictionary into `ru
21
21
"n_ancilla_qubits": 8,
22
22
"n_qubits": 16,
23
23
"n_layers": 2,
24
-
"n_trajectories": 128,
24
+
"n_trajectories": 64,
25
25
"initial_parameter_scale": 0.1,
26
26
"max_steps": 100,
27
27
"learning_rate": 0.02,
@@ -68,6 +68,14 @@ For each pair `(data_i, ancilla_i)`, apply a trainable two-qubit entangler
68
68
RZZ(theta_ent[layer, i]) on qubits (8 + i, i).
69
69
```
70
70
71
+
Then apply a fixed nearest-neighbor ancilla ladder of CNOT gates
72
+
73
+
```text
74
+
CNOT(8, 9), CNOT(9, 10), ..., CNOT(14, 15).
75
+
```
76
+
77
+
This ancilla ladder is part of every layer and is not trainable.
78
+
71
79
### 4. Mid-Circuit Ancilla Measurement
72
80
73
81
Measure each ancilla qubit `8 + i` in the computational basis, obtaining trajectory bit
@@ -76,7 +84,7 @@ Measure each ancilla qubit `8 + i` in the computational basis, obtaining traject
76
84
m[layer, i] in {0, 1}.
77
85
```
78
86
79
-
Use exactly `n_trajectories = 128` trajectories per objective evaluation, and keep the per-trajectory measurement randomness fixed across optimizer updates so the objective is a reproducible trajectory average rather than an optimizer-side resampling procedure.
87
+
Use exactly `n_trajectories = 64` trajectories per objective evaluation, and keep the per-trajectory measurement randomness fixed across optimizer updates so the objective is a reproducible trajectory average rather than an optimizer-side resampling procedure.
80
88
81
89
### 5. Conditional Feedback Layer
82
90
@@ -89,6 +97,16 @@ These two feedback angles are independent trainable parameters.
89
97
90
98
### 6. Data Post-Processing Layer
91
99
100
+
After all conditional feedback gates in the layer, apply a fixed nearest-neighbor data ladder of CNOT gates
101
+
102
+
```text
103
+
CNOT(0, 1), CNOT(1, 2), ..., CNOT(6, 7).
104
+
```
105
+
106
+
This data ladder is part of every layer and is not trainable.
107
+
108
+
### 7. Data Post-Processing Layer
109
+
92
110
Apply trainable `RZ` rotations on all data qubits:
93
111
94
112
```text
@@ -97,7 +115,7 @@ RZ(theta_post[layer, i]) on data qubit i, i = 0,...,7.
97
115
98
116
## Objective Function
99
117
100
-
For a fixed parameter vector and a fixed batch of `128` trajectory uniforms, the protocol produces `128` measurement-conditioned trajectories. Let `E_t` be the data-Hamiltonian expectation value on trajectory `t`. The objective is the trajectory-averaged energy
118
+
For a fixed parameter vector and a fixed batch of `64` trajectory uniforms, the protocol produces `64` measurement-conditioned trajectories. Let `E_t` be the data-Hamiltonian expectation value on trajectory `t`. The objective is the trajectory-averaged energy
`energy_history[t]` records the trajectory-averaged energy evaluated immediately before optimizer update `t`.
128
146
129
-
`final_trajectory_energies[k]` records the final per-trajectory data-Hamiltonian energy for the same fixed batch of `128` trajectory uniforms used by the objective.
147
+
`final_trajectory_energies[k]` records the final per-trajectory data-Hamiltonian energy for the same fixed batch of `64` trajectory uniforms used by the objective.
130
148
131
149
## Evaluation Interface
132
150
@@ -154,7 +172,7 @@ It does not save files or create plots by default.
154
172
A run is considered functionally successful when all of the following hold for the default configuration:
155
173
156
174
-`len(energy_history) == 100`
157
-
-`final_trajectory_energies.shape == (128,)`
175
+
-`final_trajectory_energies.shape == (64,)`
158
176
- the final trajectory-averaged energy is lower than the initial trajectory-averaged energy
159
177
- the total energy improvement is at least `minimum_improvement = 0.3`
160
178
- the final trajectory-averaged energy is at most `target_final_energy = -8.3`
- Final trajectory-averaged energy: `-10.0266914368`.
196
+
- Energy improvement: `3.1804246902`.
197
+
- Final trajectory energy mean/std: `-10.0323581696 / 0.0036470860`.
180
198
- Energy history length: `100`.
181
199
- Overall: `PASS`.
182
200
183
201
This time is a reference measurement only and is not a passing criterion.
184
202
185
203
## Implementation Hint
186
204
187
-
For a TensorCircuit-NG/JAX baseline, use `cond_measure` for ancilla measurements, batch the `128`fixed trajectories with `vmap`, and JIT-compile the full optimizer step rather than only `value_and_grad`, so each update reuses one compiled trajectory-averaged objective-and-update path.
205
+
For a TensorCircuit-NG/JAX baseline, use `cond_measure` for ancilla measurements, batch the fixed trajectories with `vmap`, and JIT-compile the full optimizer step rather than only `value_and_grad`, so each update reuses one compiled trajectory-averaged objective-and-update path.
0 commit comments