Fold long circuit drawings

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by locating _drawer.py and reading the shortcut: note mentioned in the issue, then trace how print(qc) and qc.draw render circuit operations. The issue proposes terminal-width folding and packing non-overlapping gates into columns; done means long drawings wrap and gates on separate qubits share columns, with fold=None disabling folding.

Written by the indexing model from the issue text.

Description

enhancement
What you want to do

print(qc) draws one column per operation and never wraps, so a circuit with a hundred gates is
one line hundreds of characters wide. _drawer.py notes this as a shortcut:.

Implementation notes

Also pack gates on qubits that don't overlap into the same column, which shortens most drawings a lot.

What it could look like
print(qc)                 # folds at the terminal width
qc.draw(fold=80)          # explicit width; fold=None for no folding
Contributing
  • I would like to open a pull request for this (see CONTRIBUTING.md).
Dominant language
Rust
Stars
1
Forks
0
Avg merge
12m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kaiwave/qsengine

All issues in kaiwave/qsengine

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.