Skip to content

Commit

Permalink
Fix a bug in the labelling
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxiLi committed May 7, 2021
1 parent 5ffb267 commit e48618f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/qutip_qip/device/circuitqed.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ def get_operators_labels(self):
It is a 2-d nested list, in the plot,
a different color will be used for each sublist.
"""
return ([[r"$\sigma_x^%d$" % n for n in range(self.num_qubits)],
[r"$\sigma_y^%d$" % n for n in range(self.num_qubits)],
[r"$ZX^{%d%d}$"
% (n, n + 1) for n in range(self.num_qubits - 1)] +
[r"$ZX^{%d%d}$"
% (n + 1, n) for n in range(self.num_qubits - 1)],
])
labels = [[r"$\sigma_x^%d$" % n for n in range(self.num_qubits)],
[r"$\sigma_y^%d$" % n for n in range(self.num_qubits)]]
label_zx = []
for m in range(self.num_qubits - 1):
label_zx.append("ZX^{%d%d}"% (m, m + 1))
label_zx.append("ZX^{%d%d}"% (m + 1, m))
labels.append(label_zx)
return labels

def topology_map(self, qc):
return to_chain_structure(qc)

0 comments on commit e48618f

Please sign in to comment.