Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qiskit/transpiler/passes/calibration/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def rescale_cr_inst(instruction: Play, theta: float, sample_mult: int = 16) -> P
gaussian_area = abs(amp) * sigma * np.sqrt(2 * np.pi) * math.erf(n_sigmas)
area = gaussian_area + abs(amp) * width

target_area = abs(theta) / (np.pi / 2.0) * area
sign = theta / abs(theta)
target_area = abs(float(theta)) / (np.pi / 2.0) * area
sign = theta / abs(float(theta))

if target_area > gaussian_area:
width = (target_area - gaussian_area) / abs(amp)
Expand Down
13 changes: 10 additions & 3 deletions qiskit/transpiler/passes/scheduling/alap.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,16 @@ def pad_with_delays(qubits: List[int], until, unit) -> None:
# validate node.op.duration
if node.op.duration is None:
indices = [bit_indices[qarg] for qarg in node.qargs]
raise TranspilerError(
f"Duration of {node.op.name} on qubits {indices} is not found."
)
if node.op.name in dag.calibrations:
if dag.calibrations[node.op.name] is not None:
for key in dag.calibrations[node.op.name]:
if tuple(indices) in key:
Comment thread
nbronn marked this conversation as resolved.
Outdated
node.op.duration = dag.calibrations[node.op.name][key].duration

if node.op.duration is None:
raise TranspilerError(
f"Duration of {node.op.name} on qubits {indices} is not found."
)
if isinstance(node.op.duration, ParameterExpression):
indices = [bit_indices[qarg] for qarg in node.qargs]
raise TranspilerError(
Expand Down
13 changes: 10 additions & 3 deletions qiskit/transpiler/passes/scheduling/asap.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ def pad_with_delays(qubits: List[int], until, unit) -> None:
# validate node.op.duration
if node.op.duration is None:
indices = [bit_indices[qarg] for qarg in node.qargs]
raise TranspilerError(
f"Duration of {node.op.name} on qubits {indices} is not found."
)
if node.op.name in dag.calibrations:
if dag.calibrations[node.op.name] is not None:
for key in dag.calibrations[node.op.name]:
if tuple(indices) in key:
node.op.duration = dag.calibrations[node.op.name][key].duration

if node.op.duration is None:
raise TranspilerError(
f"Duration of {node.op.name} on qubits {indices} is not found."
)
if isinstance(node.op.duration, ParameterExpression):
indices = [bit_indices[qarg] for qarg in node.qargs]
raise TranspilerError(
Expand Down