Skip to content

Commit

Permalink
fix if statement on state
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles MOUSSA committed Nov 11, 2024
1 parent 86385f8 commit fb65e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qadence/measurements/shadow.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def classical_shadow(
unitary_ids = np.random.randint(0, 3, size=(shadow_size, circuit.n_qubits))
all_unitaries = extract_unitaries(unitary_ids, circuit.n_qubits)
shadow: list = list()
batchsize = state.shape[0] if state else 1
batchsize = state.shape[0] if state is not None else 1
for i in range(shadow_size):
random_unitary_block = all_unitaries[i]
rotated_circuit = rotate(circuit, (random_unitary_block, 1.0))
Expand Down

0 comments on commit fb65e0d

Please sign in to comment.