Skip to content

Commit 5a8de51

Browse files
update examples
1 parent 97e0325 commit 5a8de51

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

examples/lambdify_jax_symbolcircuit.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
conjugate(sin(theta)) → sin(theta) when building the bra side of <psi|O|psi>.
77
Without real=True, conjugate() wrappers remain unevaluated and the symbolic
88
expression looks complex even though the value is always real for real inputs.
9-
10-
Run with:
11-
conda run -n 2602 python examples/lambdify_jax.py
129
"""
1310

1411
import sympy
@@ -100,17 +97,3 @@ def make_jax_fn(expr, symbols):
10097
batch = jnp.linspace(0.0, jnp.pi, 9)
10198
f_zz_vmap = jax.vmap(f_zz)
10299
print("batch <ZZ> over [0, π]:", f_zz_vmap(batch))
103-
104-
# ── 9. Complex-output observable ──────────────────────────────────────────────
105-
106-
print("\n--- <Y0> ---")
107-
if syms_y0:
108-
arg_vals = {theta: TH, phi: PH}
109-
call_args = [jnp.array(float(arg_vals[s])) for s in syms_y0]
110-
val_y0 = f_y0(*call_args)
111-
ref_y0 = c_ref.expectation_ps(y=[0])
112-
print(f"f_y0({syms_y0}):", val_y0)
113-
print("tc <Y0>:", ref_y0)
114-
print("match:", jnp.allclose(jnp.array(val_y0, dtype=jnp.complex128), ref_y0))
115-
else:
116-
print("<Y0> has no free symbols (constant):", complex(expr_y0))

examples/qaoa_symbolic.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
x RZZ(-gamma) on (0,1) and RZZ(-gamma) on (1,2)
3333
3434
U_M(beta) = prod_i RX(2 beta)
35-
36-
Run:
37-
conda run -n 2602 python examples/qaoa_symbolic.py
3835
"""
3936

4037
import sympy

0 commit comments

Comments
 (0)