Skip to content

Commit

Permalink
Resolve issue with bad type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
minwook-shin committed Sep 29, 2023
1 parent 2d8d172 commit 93cc146
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def actual_convert_action(self):
for layer in dag.layers():
circuit = self.qiskit.converters.dag_to_circuit(layer['graph'])
matrix_list["gate"].append(self.qiskit.quantum_info.Operator(circuit).to_matrix())
gate_name = ""
gates = []
for _inst in circuit.data:
if _inst[0].name == "cx":
gate_name = (_inst[0].name +
Expand All @@ -54,7 +54,8 @@ def actual_convert_action(self):
", q" + str(_inst.qubits[2].index) + "}")
else:
gate_name = _inst[0].name
matrix_list["name"].append((layer_index, gate_name))
gates.append(gate_name)
matrix_list["name"].append((layer_index, gates))
layer_index += 1
matrix_list["result"] = self.qiskit.quantum_info.Operator(self.input_value).to_matrix()
if self.option.get("print", False) == "raw":
Expand Down

0 comments on commit 93cc146

Please sign in to comment.