memq_dqc.visualization¶
visualization
¶
Visualization helpers for memq_dqc.
ExecutionFrame
dataclass
¶
One rendered instant of a schedule playback.
Attributes:
| Name | Type | Description |
|---|---|---|
time |
float
|
Schedule time this frame depicts, in scheduler time units. |
events |
tuple[ScheduleEvent, ...]
|
Events in flight at |
NetworkExecutionAnimation
¶
NetworkExecutionAnimation(
network: NetworkGraph,
schedule: OperationSchedule,
*,
mode: PlaybackMode = "events",
num_frames: int = 240,
interval: int = 400,
repeat: bool = True,
title: str | None = None,
figsize: tuple[float, float] | None = None,
pos: dict[PhysicalQubit, tuple[float, float]]
| None = None,
show_labels: bool = True,
controls: bool = False,
)
Playable animation of a schedule over a physical-qubit network graph.
Instances build their figure and frame list eagerly, then expose the animation for display (show), notebook embedding (to_jshtml), or export (save).
Initialize the animation and render its first frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
NetworkGraph
|
Network the schedule was produced for. |
required |
schedule
|
OperationSchedule
|
Operation schedule to play back. |
required |
mode
|
PlaybackMode
|
|
'events'
|
num_frames
|
int
|
Frame count for |
240
|
interval
|
int
|
Delay between frames in milliseconds. |
400
|
repeat
|
bool
|
Whether playback loops. |
True
|
title
|
str | None
|
Figure title, or |
None
|
figsize
|
tuple[float, float] | None
|
Figure size in inches. |
None
|
pos
|
dict[PhysicalQubit, tuple[float, float]] | None
|
Explicit node positions, or |
None
|
show_labels
|
bool
|
Whether to label nodes with physical-qubit names. |
True
|
controls
|
bool
|
Whether to attach play/pause and scrub widgets. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the schedule is empty, |
Source code in src/memq_dqc/visualization/execution_animator.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |
frames
property
¶
frames: tuple[ExecutionFrame, ...]
Return the frames this animation plays through.
show
¶
Display the animation in an interactive window with controls.
Attaches play/pause and scrub widgets if they are not already present, then blocks on the active matplotlib backend.
Source code in src/memq_dqc/visualization/execution_animator.py
save
¶
Write the animation to a file.
The writer is chosen from the extension: .gif uses Pillow, .mp4
needs ffmpeg on the path, and .html writes a self-contained
JavaScript player.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike[str]
|
Destination path, including extension. |
required |
fps
|
int
|
Frames per second in the written file. |
3
|
dpi
|
int
|
Output resolution in dots per inch. |
150
|
Source code in src/memq_dqc/visualization/execution_animator.py
to_jshtml
¶
Return a self-contained HTML player for notebook display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fps
|
int
|
Frames per second for the embedded player. |
3
|
Returns:
| Type | Description |
|---|---|
str
|
HTML markup with play, pause, and scrub controls. |
Source code in src/memq_dqc/visualization/execution_animator.py
SvgDashboardPanel
dataclass
¶
SvgDashboardPanel(
title: str,
document: SvgDocument,
description: str | None = None,
)
A single visualization card inside an HTML dashboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Card heading shown above the embedded SVG. |
required |
document
|
SvgDocument
|
SVG document rendered inside the card. |
required |
description
|
str | None
|
Optional supporting text shown under the title. |
None
|
SvgDashboardSection
dataclass
¶
SvgDashboardSection(
title: str,
panels: Sequence[SvgDashboardPanel],
description: str | None = None,
)
A grouped dashboard section containing one or more visualization cards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Section heading shown in the dashboard. |
required |
panels
|
Sequence[SvgDashboardPanel]
|
Visualization cards rendered within the section. |
required |
description
|
str | None
|
Optional supporting text shown under the heading. |
None
|
SvgDocument
dataclass
¶
A standalone SVG visualization artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
Canvas width in pixels. |
required |
height
|
int
|
Canvas height in pixels. |
required |
svg
|
str
|
Full SVG markup for the document. |
required |
write_svg
¶
Write the SVG markup to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Destination SVG filepath. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The resolved output path. |
Source code in src/memq_dqc/visualization/svg_document.py
to_html
¶
Wrap the SVG in a lightweight interactive HTML viewer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Viewer title shown above the canvas. |
'Visualization'
|
Returns:
| Type | Description |
|---|---|
str
|
A standalone HTML document with pan and zoom controls. |
Source code in src/memq_dqc/visualization/svg_document.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
write_html
¶
Write the interactive HTML viewer to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Destination HTML filepath. |
required |
title
|
str
|
Viewer title shown above the canvas. |
'Visualization'
|
Returns:
| Type | Description |
|---|---|
Path
|
The resolved output path. |
Source code in src/memq_dqc/visualization/svg_document.py
write_png
¶
Rasterize the SVG document to PNG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Destination PNG filepath. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The resolved output path. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
Source code in src/memq_dqc/visualization/svg_document.py
plot_distributed_circuit
¶
plot_distributed_circuit(
circuit: Circuit,
*,
schedule: PartitionSchedule | None = None,
windows: PartitionWindows | None = None,
start_window: int = 0,
max_windows: int | None = None,
max_ops_per_window: int | None = None,
title: str | None = None,
) -> SvgDocument
Render a distributed circuit view as SVG.
Wires represent QPU-local physical slots rather than global logical-qubit
indices. Slot labels restart from zero inside each QPU group, and QPU
boundaries are separated by dotted rules. Remote gates use a red dashed
variant of the local-gate style, while state teleportation swaps are shown
as forward-leaning connectors between QPU groups. If the circuit declares
classical bits, they are rendered as double-line wires beneath the quantum
rows, with dotted measurement arrows from M_z boxes to their targets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit
|
Circuit
|
Circuit to render. |
required |
schedule
|
PartitionSchedule | None
|
Optional partition schedule used for QPU-aware placement. |
None
|
windows
|
PartitionWindows | None
|
Optional partition windows aligned with |
None
|
start_window
|
int
|
First window to render. |
0
|
max_windows
|
int | None
|
Optional cap on the number of windows to render. |
None
|
max_ops_per_window
|
int | None
|
Optional cap on visible operations per window. |
None
|
title
|
str | None
|
Optional chart title. |
None
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the circuit visualization. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If schedule and windows do not align or the selected window slice is empty. |
Source code in src/memq_dqc/visualization/compiler_visualizer.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
plot_operation_gantt
¶
plot_operation_gantt(
circuit: Circuit,
*,
schedule: PartitionSchedule | None = None,
windows: PartitionWindows | None = None,
start_window: int = 0,
max_windows: int | None = None,
max_ops_per_window: int | None = None,
title: str | None = None,
) -> SvgDocument
Render an operation-level Gantt chart as SVG.
Time progresses left-to-right in unit intervals, and every operation spans one interval. Operations that share a DAG layer occupy the same time slot and are stacked on separate rows so parallel work appears vertically aligned instead of serialized along the x-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit
|
Circuit
|
Circuit to render. |
required |
schedule
|
PartitionSchedule | None
|
Optional partition schedule used for QPU-aware placement. |
None
|
windows
|
PartitionWindows | None
|
Optional partition windows aligned with |
None
|
start_window
|
int
|
First window to render. |
0
|
max_windows
|
int | None
|
Optional cap on the number of windows to render. |
None
|
max_ops_per_window
|
int | None
|
Optional cap on visible operations per window. |
None
|
title
|
str | None
|
Optional chart title. |
None
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the Gantt visualization. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If schedule and windows do not align or the selected window slice is empty. |
Source code in src/memq_dqc/visualization/compiler_visualizer.py
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | |
plot_partition_flow
¶
plot_partition_flow(
schedule: PartitionSchedule,
*,
show_node_counts: bool | None = None,
title: str | None = None,
) -> SvgDocument
Render an alluvial-style partition flow view as SVG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schedule
|
PartitionSchedule
|
Timeline of partition assignments. |
required |
show_node_counts
|
bool | None
|
Whether occupancy labels should be drawn inside the QPU boxes. If omitted, labels appear only for shorter schedules. |
None
|
title
|
str | None
|
Optional chart title. |
None
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the partition-flow visualization. |
Source code in src/memq_dqc/visualization/compiler_visualizer.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | |
plot_window_activity
¶
plot_window_activity(
circuit: Circuit,
schedule: PartitionSchedule,
windows: PartitionWindows,
*,
title: str | None = None,
) -> SvgDocument
Render per-window gate composition and movement pressure as SVG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit
|
Circuit
|
Circuit providing the operation set. |
required |
schedule
|
PartitionSchedule
|
Partition schedule aligned with |
required |
windows
|
PartitionWindows
|
Operation windows from the partitioner. |
required |
title
|
str | None
|
Optional chart title. |
None
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the window-activity summary. |
Source code in src/memq_dqc/visualization/compiler_visualizer.py
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 | |
build_dag_networkx_graph
¶
build_dag_networkx_graph(dag: CircuitDAG) -> DiGraph
Build an augmented NetworkX graph for DAG visualization.
The visualization graph adds synthetic input and output nodes for each qubit wire so the rendered layout reads like a circuit-flow graph rather than a generic dependency diagram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dag
|
CircuitDAG
|
Circuit DAG to augment for visualization. |
required |
Returns:
| Type | Description |
|---|---|
DiGraph
|
A directed graph containing qubit input nodes, operation nodes, qubit |
DiGraph
|
output nodes, and dependency edges annotated by qubit labels. |
Source code in src/memq_dqc/visualization/dag_visualizer.py
plot_circuit_dag
¶
plot_circuit_dag(
circuit_or_dag: Circuit | CircuitDAG,
*,
ax: Axes | None = None,
title: str = "Circuit DAG",
show_edge_labels: bool = False,
) -> Axes
Render the monolithic circuit DAG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit_or_dag
|
Circuit | CircuitDAG
|
Circuit or DAG to plot. |
required |
ax
|
Axes | None
|
Existing axes to draw into. |
None
|
title
|
str
|
Plot title. |
'Circuit DAG'
|
show_edge_labels
|
bool
|
Whether qubit labels should be shown on edges. |
False
|
Returns:
| Type | Description |
|---|---|
Axes
|
The Matplotlib axes containing the rendered DAG. |
Source code in src/memq_dqc/visualization/dag_visualizer.py
plot_dag
¶
plot_dag(
dag: CircuitDAG,
*,
ax: Axes | None = None,
title: str | None = None,
show_edge_labels: bool = False,
) -> Axes
Render a circuit DAG as a top-to-bottom NetworkX graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dag
|
CircuitDAG
|
DAG to visualize. |
required |
ax
|
Axes | None
|
Existing axes to draw into. A new figure and axes are created when omitted. |
None
|
title
|
str | None
|
Optional plot title. |
None
|
show_edge_labels
|
bool
|
Whether qubit labels should be shown on edges. |
False
|
Returns:
| Type | Description |
|---|---|
Axes
|
The Matplotlib axes containing the rendered DAG. |
Source code in src/memq_dqc/visualization/dag_visualizer.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
plot_distributed_dag
¶
plot_distributed_dag(
circuit_or_dag: Circuit
| DistributedCircuit
| CircuitDAG,
*,
ax: Axes | None = None,
title: str = "Distributed DAG",
show_edge_labels: bool = False,
) -> Axes
Render the distributed circuit DAG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit_or_dag
|
Circuit | DistributedCircuit | CircuitDAG
|
Circuit, distributed circuit wrapper, or DAG to plot. |
required |
ax
|
Axes | None
|
Existing axes to draw into. |
None
|
title
|
str
|
Plot title. |
'Distributed DAG'
|
show_edge_labels
|
bool
|
Whether qubit labels should be shown on edges. |
False
|
Returns:
| Type | Description |
|---|---|
Axes
|
The Matplotlib axes containing the rendered DAG. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the circuit does not yet have a distributed DAG. |
Source code in src/memq_dqc/visualization/dag_visualizer.py
animate_circuit_execution
¶
animate_circuit_execution(
network: NetworkGraph,
schedule: OperationSchedule,
*,
mode: PlaybackMode = "events",
num_frames: int = 240,
interval: int = 400,
repeat: bool = True,
title: str | None = None,
figsize: tuple[float, float] | None = None,
pos: dict[PhysicalQubit, tuple[float, float]]
| None = None,
show_labels: bool = True,
controls: bool = False,
) -> NetworkExecutionAnimation
Animate a schedule over its network graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
NetworkGraph
|
Network the schedule was produced for. Its graph supplies the nodes (physical qubits) and the local/remote edges. |
required |
schedule
|
OperationSchedule
|
Operation schedule to play back. |
required |
mode
|
PlaybackMode
|
|
'events'
|
num_frames
|
int
|
Number of frames to sample in |
240
|
interval
|
int
|
Delay between frames in milliseconds. |
400
|
repeat
|
bool
|
Whether playback loops back to the start when it finishes. |
True
|
title
|
str | None
|
Figure title. Defaults to a generated summary of the schedule. |
None
|
figsize
|
tuple[float, float] | None
|
Figure size in inches. |
None
|
pos
|
dict[PhysicalQubit, tuple[float, float]] | None
|
Explicit node positions. Defaults to qpu_clustered_layout. |
None
|
show_labels
|
bool
|
Whether to draw physical-qubit labels on the nodes. |
True
|
controls
|
bool
|
Whether to reserve space for, and attach, play/pause and scrub widgets. NetworkExecutionAnimation.show enables this automatically, so it is only needed when embedding the figure. |
False
|
Returns:
| Type | Description |
|---|---|
NetworkExecutionAnimation
|
The animation wrapper. Keep a reference to it for as long as playback |
NetworkExecutionAnimation
|
should continue; dropping it lets the underlying timer be collected. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the schedule has no events, if |
Source code in src/memq_dqc/visualization/execution_animator.py
qpu_clustered_layout
¶
qpu_clustered_layout(
network: NetworkGraph,
*,
cluster_scale: float = 0.45,
seed: int = 7,
) -> dict[PhysicalQubit, tuple[float, float]]
Lay out a network graph as one visual cluster per QPU.
Each QPU's qubits are laid out with a spring layout over that QPU's local edges only, normalized into a disk, and then placed at a QPU centre spaced evenly around a circle. Intra-QPU edges therefore stay short and inside a cluster while inter-QPU edges visibly span between clusters, which is the property that makes the two connection types easy to tell apart.
The circle the centres sit on grows with the QPU count so that clusters never collide, and two QPUs are placed side by side rather than stacked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
NetworkGraph
|
Network whose graph should be laid out. |
required |
cluster_scale
|
float
|
Radius of one QPU cluster in layout units. |
0.45
|
seed
|
int
|
Seed for the per-QPU spring layout, so layouts are reproducible. |
7
|
Returns:
| Type | Description |
|---|---|
dict[PhysicalQubit, tuple[float, float]]
|
Mapping of every physical qubit to its |
Source code in src/memq_dqc/visualization/execution_animator.py
plot_migration_timeline
¶
plot_migration_timeline(
partition: PartitionTimeline,
*,
title: str | None = None,
window_entanglement_cost: list[float] | None = None,
) -> SvgDocument
Render moved-qubits-per-window as an SVG line chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
partition
|
PartitionTimeline
|
Timeline of partitions (window -> QPU -> qubit set). |
required |
title
|
str | None
|
Optional chart title. |
None
|
window_entanglement_cost
|
list[float] | None
|
Optional series to plot on a secondary axis. |
None
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the migration timeline. |
Source code in src/memq_dqc/visualization/partition_visualizer.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
plot_partition_heatmap
¶
plot_partition_heatmap(
partition: PartitionTimeline,
*,
title: str | None = None,
top_k_most_moved: int | None = None,
sample_stride: int | None = None,
sort_by_final_qpu: bool = False,
x_tick_stride: int | None = 5,
y_tick_fontsize: int = 8,
) -> SvgDocument
Render a qubit-vs-window partition heatmap as SVG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
partition
|
PartitionTimeline
|
Timeline of partitions (window -> QPU -> qubit set). |
required |
title
|
str | None
|
Optional chart title. |
None
|
top_k_most_moved
|
int | None
|
If provided, keep only the qubits that moved most often across windows. |
None
|
sample_stride
|
int | None
|
If provided, keep every Nth qubit after filtering. |
None
|
sort_by_final_qpu
|
bool
|
Whether to group rows by the final window QPU. |
False
|
x_tick_stride
|
int | None
|
Window tick spacing. If None, show every window. |
5
|
y_tick_fontsize
|
int
|
Font size for y-axis labels. |
8
|
Returns:
| Type | Description |
|---|---|
SvgDocument
|
An SVG document containing the heatmap. |
Source code in src/memq_dqc/visualization/partition_visualizer.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
build_svg_dashboard_html
¶
build_svg_dashboard_html(
sections: Sequence[SvgDashboardSection],
*,
title: str = "Visualization Dashboard",
) -> str
Build a standalone HTML dashboard for multiple SVG visualizations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sections
|
Sequence[SvgDashboardSection]
|
Ordered dashboard sections to render. |
required |
title
|
str
|
Document title shown at the top of the dashboard. |
'Visualization Dashboard'
|
Returns:
| Type | Description |
|---|---|
str
|
A standalone HTML document with all provided visualizations embedded. |
Source code in src/memq_dqc/visualization/svg_document.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | |
write_svg_dashboard_html
¶
write_svg_dashboard_html(
path: str | Path,
sections: Sequence[SvgDashboardSection],
*,
title: str = "Visualization Dashboard",
) -> Path
Write a standalone SVG dashboard HTML document to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Destination HTML filepath. |
required |
sections
|
Sequence[SvgDashboardSection]
|
Ordered dashboard sections to render. |
required |
title
|
str
|
Document title shown at the top of the dashboard. |
'Visualization Dashboard'
|
Returns:
| Type | Description |
|---|---|
Path
|
The resolved output path. |