select random values from the correct range

This commit is contained in:
Noa Aarts 2026-01-12 14:08:03 +01:00
parent e011a14df5
commit 147267eff1
Signed by: noa
GPG key ID: 1850932741EFF672

View file

@ -160,7 +160,10 @@ class QuantumCircuit:
nexp = 2 * samples
# vectorized binds: one circuit, many parameter values
binds: list[dict[ParameterVectorElement, list[float]]] = [
{param: [rng.random() for _ in range(nexp)] for param in thetas.params}
{
param: [rng.random() * 4 * math.pi - 2 * math.pi for _ in range(nexp)]
for param in thetas.params
}
]
job = backend.run([tqc], parameter_binds=binds)