Skip to content

Commit 189d201

Browse files
update problem 4 and fix problem 10
1 parent ccaeea4 commit 189d201

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

examples/challenge_suite/evaluate_10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def evaluate(solution_module, config):
125125

126126
print("Challenge 10 evaluation")
127127
print(f"Solution module: {solution_module}")
128-
print(f"Solution time: {solution_elapsed:.2f}s")
128+
print(f"End-to-end solution time: {solution_elapsed:.2f}s")
129129
print(f"Exact reference time: {exact_elapsed:.2f}s")
130130
print(f"Qubits: {config['n_qubits']}")
131131
print(f"Selected CMZ qubits: {len(config['selected_qubits'])}")

examples/challenge_suite/problem_10.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ Required result keys:
6565
- `energy_history`: NumPy array with shape `(max_steps,)`.
6666
- `final_parameters`: final rotation tensor with shape `(n_layers, n_qubits, 3)`.
6767

68-
Each history records one value per optimizer update, evaluated immediately before applying that update. The evaluator derives initial/final energy density from the first/last entries of `energy_history`. The largest gate size and requested step count are fixed by the evaluator configuration and are not returned by the solution.
68+
Each entry of `energy_history` must store the **energy density**
69+
70+
```text
71+
<H> / n_qubits
72+
```
73+
74+
evaluated immediately before the corresponding optimizer update, not the raw total energy `<H>`. The evaluator derives initial/final energy density from the first/last entries of `energy_history`. The largest gate size and requested step count are fixed by the evaluator configuration and are not returned by the solution.
6975

7076
## Evaluation Interface
7177

@@ -75,7 +81,7 @@ The evaluator file is `evaluate_10.py`. It dynamically imports a solution module
7581
python evaluate_10.py --solution solution_10
7682
```
7783

78-
The evaluator consumes only the returned result dictionary. It prints solution time, exact-reference time, initial and final energy densities, exact ground-state energy density, VQE gap, energy-history length, largest gate size, returned keys, and pass/fail criteria. It does not save files or create plots by default.
84+
The evaluator consumes only the returned result dictionary. It prints end-to-end solution time, exact-reference time, initial and final energy densities, exact ground-state energy density, VQE gap, energy-history length, largest gate size, returned keys, and pass/fail criteria. It does not save files or create plots by default.
7985

8086
## Passing Criteria
8187

@@ -99,7 +105,7 @@ python evaluate_10.py --solution solution_10
99105

100106
Observed TensorCircuit-NG/JAX baseline in the current validation environment with the default 200-step configuration:
101107

102-
- Solution time: `66.30s`.
108+
- End-to-end solution time: `66.30s`.
103109
- Exact reference time: `30.69s`.
104110
- Initial energy density: `0.9718770385`.
105111
- Final energy density: `-1.1766326427`.

examples/challenge_suite/problem_4.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Here `p01` is the probability for `0 -> 1` and `p10` is the probability for `1 -
3434

3535
Use four fixed 12-qubit inputs and the same noisy probe circuit for every input. The four inputs are a GHZ state `(|0...0> + |1...1>) / sqrt(2)`, Bell-like pair states `(|01> + |10>) / sqrt(2)` on pairs `(0,1), (2,3), ..., (10,11)`, `|0>^12`, and `|+>^12`.
3636

37-
The shared probe circuit is one even-bond brickwork entangler layer. On every bond `(0,1), (2,3), ..., (10,11)`, apply `RXX(0.31)` with convention `RXX(theta) = exp(-i theta X_i X_j / 2)`, and then apply the asymmetric bit-flip channel independently to the two qubits in that bond.
37+
The shared probe circuit has two brickwork entangler sublayers. First apply one even-bond layer on bonds `(0,1), (2,3), ..., (10,11)`, where each bond receives `RXX(0.31)` with convention `RXX(theta) = exp(-i theta X_i X_j / 2)` followed by the asymmetric bit-flip channel independently on both qubits in that bond. Then apply one offset odd-bond layer on bonds `(1,2), (3,4), ..., (9,10)` with the same `RXX(0.31)` entangler and the same per-qubit asymmetric bit-flip channel after each odd-bond entangler.
3838

3939
All probes therefore have identical noisy entangler structure and differ only in the initial state.
4040

@@ -99,15 +99,15 @@ The TensorCircuit-NG solution in `solution_4.py` can be evaluated with:
9999
python evaluate_4.py --solution solution_4
100100
```
101101

102-
Observed TensorCircuit-NG/JAX baseline in the current validation environment with the entangled-probe default configuration:
102+
Observed TensorCircuit-NG/JAX baseline in the current validation environment with the two-sublayer entangled-probe default configuration:
103103

104-
- End-to-end solution time: `47.45s`.
105-
- Initial loss: `6.70448504e-03`.
106-
- Final loss: `3.09971142e-08`.
107-
- Fitted `p01`: `0.03398004`.
108-
- Fitted `p10`: `0.01109863`.
104+
- End-to-end solution time: `32.91s`.
105+
- Initial loss: `7.07078446e-03`.
106+
- Final loss: `2.54623540e-08`.
107+
- Fitted `p01`: `0.03403885`.
108+
- Fitted `p10`: `0.01104033`.
109109
- Trace-preserving error: `1.11022302e-16`.
110110

111111
## Implementation Hint
112112

113-
For a TensorCircuit-NG/JAX baseline, use `DMCircuit` with `apply_general_kraus` to insert the custom one-qubit channel after each entangling operation. The probes share one noisy entangler structure and differ only in their initial states, keeping the benchmark focused on the trainable channel. Keep the Kraus operators as differentiable tensor algebra, enforce positivity with sigmoid-parameterized probabilities, and verify trace preservation by contracting `sum_a K_a^\dagger K_a`.
113+
For a TensorCircuit-NG/JAX baseline, use `DMCircuit` with `apply_general_kraus` to insert the custom one-qubit channel after each entangling operation in both the even-bond and odd-bond sublayers. The probes share one noisy entangler structure and differ only in their initial states, keeping the benchmark focused on the trainable channel. Keep the Kraus operators as differentiable tensor algebra, enforce positivity with sigmoid-parameterized probabilities, and verify trace preservation by contracting `sum_a K_a^\dagger K_a`.

examples/challenge_suite/runtime_summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Evaluator-reported `End-to-end solution time` for the current 12 problems on Mac
77
| 1 | 27.22s |
88
| 2 | 2.87s |
99
| 3 | 2.46s |
10-
| 4 | 47.45s |
10+
| 4 | 36.11s |
1111
| 5 | 45.50s |
1212
| 6 | 26.83s |
1313
| 7 | 63.84s |

examples/challenge_suite/solution_4.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ def apply_channel(circuit, kraus, qubits):
7171

7272

7373
def apply_noisy_entangler_layer(circuit, kraus, config):
74-
for i in range(0, config["n_qubits"] - 1, 2):
75-
circuit.rxx(i, i + 1, theta=config["entangler_angle"])
76-
apply_channel(circuit, kraus, (i, i + 1))
74+
for start in (0, 1):
75+
for i in range(start, config["n_qubits"] - 1, 2):
76+
circuit.rxx(i, i + 1, theta=config["entangler_angle"])
77+
apply_channel(circuit, kraus, (i, i + 1))
7778

7879

7980
def prepare_initial_state(circuit, probe_index, config):

0 commit comments

Comments
 (0)