Skip to content

Commit

Permalink
refactor: improve readability
Browse files Browse the repository at this point in the history
Co-authored-by: Alessandro Candido <candido.ale@gmail.com>
  • Loading branch information
andrea-pasquale and alecandido committed Sep 23, 2024
1 parent f1db5c7 commit 585e758
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/qibocal/protocols/state_tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ def _fit(data: StateTomographyData) -> StateTomographyResults:
circuit.density_matrix = True
total_density_matrix = NumpyBackend().execute_circuit(circuit=circuit).state()
for i, qubit in enumerate(data.targets):
traced_qubits = list(range(len(data.qubits)))
traced_qubits.remove(i)
traced_qubits = [q for q in range(len(data.qubits)) if q != i]
target_density_matrix = NumpyBackend().partial_trace_density_matrix(
total_density_matrix, traced_qubits, len(data.qubits)
)
Expand Down

0 comments on commit 585e758

Please sign in to comment.