client-superstaq icon indicating copy to clipboard operation
client-superstaq copied to clipboard

Cosmetic/pretty printing of compiler output

Open dowusu-antwi opened this issue 1 year ago • 3 comments

Fixes #144. (edit: Now with circuit drawings.) E.g.,

import qiskit_superstaq as qss
import qiskit
qc = qiskit.QuantumCircuit(1)
qc.h(0)
qc.draw()

provider = qss.SuperstaqProvider()
compile_result = provider.ibmq_compile(qc, target="ibmq_lagos_qpu")
print(compile_result.__repr_pretty__())
# CompilerOutput(    
#          ┌─────────┐┌─────────┐┌─────────┐
#     q_0: ┤ Rz(π/2) ├┤ Rx(π/2) ├┤ Rz(π/2) ├
#          └─────────┘└─────────┘└─────────┘,
#     {0: 0},
#     Schedule(
#         (0, ShiftPhase(-1.5707963268, DriveChannel(0))),
#         (0, ShiftPhase(-1.5707963268, ControlChannel(1))),
#         (
#             0,
#             Play(
#                 Drag(
#                     duration=160,
#                     sigma=40,
#                     beta=-1.053810766518306,
#                     amp=0.1987049754148708,
#                     angle=0.022620855474399307,
#                     name="X90p_d0",
#                 ),
#                 DriveChannel(0),
#                 name="X90p_d0",
#             ),
#         ),
#         (160, ShiftPhase(-1.5707963268, DriveChannel(0))),
#         (160, ShiftPhase(-1.5707963268, ControlChannel(1))),
#         name="sched25",
#     ),
#     None,
#     None,
#     None,
# )

dowusu-antwi avatar Jul 04 '23 02:07 dowusu-antwi