Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ajavadia committed Nov 17, 2022
1 parent 0fcf929 commit 7e2f461
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
37 changes: 18 additions & 19 deletions qiskit/transpiler/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,25 +1024,24 @@ def target_to_backend_properties(target: Target):
if gate != "measure":
for qargs, props in qargs_list.items():
property_list = []
if props is not None:
if getattr(props, "duration", None) is not None:
property_list.append(
{
"date": datetime.datetime.utcnow(),
"name": "gate_length",
"unit": "s",
"value": props.duration,
}
)
if getattr(props, "error", None) is not None:
property_list.append(
{
"date": datetime.datetime.utcnow(),
"name": "gate_error",
"unit": "",
"value": props.error,
}
)
if getattr(props, "duration", None) is not None:
property_list.append(
{
"date": datetime.datetime.utcnow(),
"name": "gate_length",
"unit": "s",
"value": props.duration,
}
)
if getattr(props, "error", None) is not None:
property_list.append(
{
"date": datetime.datetime.utcnow(),
"name": "gate_error",
"unit": "",
"value": props.error,
}
)
if property_list:
gates.append(
{
Expand Down
2 changes: 1 addition & 1 deletion test/python/compiler/test_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ def test_target_ideal_gates(self, opt_level):
theta = Parameter("θ")
phi = Parameter("ϕ")
lam = Parameter("λ")
target = Target(2)
target = Target(num_qubits=2)
target.add_instruction(UGate(theta, phi, lam), {(0,): None, (1,): None})
target.add_instruction(CXGate(), {(0, 1): None})
target.add_instruction(Measure(), {(0,): None, (1,): None})
Expand Down

0 comments on commit 7e2f461

Please sign in to comment.