`show_bloq` not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
Start in qualtran/drawing/_show_funcs.py and qualtran/drawing/graphviz.py, then trace how show_bloq renders a graph through pydot. The traceback shows rendering fails because the Graphviz dot executable is missing from PATH; check the project’s installation guidance and related tests for how this dependency is expected to be handled. Done means the minimal example works or gives users clear guidance when dot is unavailable.
Written by the indexing model from the issue text.
Description
The show_bloq feature is not working. For example in the first tutorial "wiring up", I get the following FileNotFound error
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File [~/Qualtran/.venv/lib/python3.14/site-packages/pydot/core.py:1824](http://localhost:8889/lab/tree/tutorials/quantum-programming/.venv/lib/python3.14/site-packages/pydot/core.py#line=1823), in Dot.create(self, prog, format, encoding)
1823 try:
-> 1824 stdout_data, stderr_data, process = call_graphviz(
1825 program=prog,
1826 arguments=arguments,
1827 working_dir=tmp_dir,
1828 )
1829 except OSError as e:
File [~/Qualtran/.venv/lib/python3.14/site-packages/pydot/core.py:249](http://localhost:8889/lab/tree/tutorials/quantum-programming/.venv/lib/python3.14/site-packages/pydot/core.py#line=248), in call_graphviz(program, arguments, working_dir, **kwargs)
247 program_with_args = [program] + arguments
--> 249 process = subprocess.Popen(
250 program_with_args,
251 env=env,
252 cwd=working_dir,
253 shell=False,
254 stderr=subprocess.PIPE,
255 stdout=subprocess.PIPE,
256 **kwargs,
257 )
258 stdout_data, stderr_data = process.communicate()
File [/usr/lib/python3.14/subprocess.py:1039](http://localhost:8889/usr/lib/python3.14/subprocess.py#line=1038), in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1036 self.stderr = io.TextIOWrapper(self.stderr,
1037 encoding=encoding, errors=errors)
-> 1039 self._execute_child(args, executable, preexec_fn, close_fds,
1040 pass_fds, cwd, env,
1041 startupinfo, creationflags, shell,
1042 p2cread, p2cwrite,
1043 c2pread, c2pwrite,
1044 errread, errwrite,
1045 restore_signals,
1046 gid, gids, uid, umask,
1047 start_new_session, process_group)
1048 except:
1049 # Cleanup if the child failed starting.
File [/usr/lib/python3.14/subprocess.py:1990](http://localhost:8889/usr/lib/python3.14/subprocess.py#line=1989), in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
1989 if err_filename is not None:
-> 1990 raise child_exception_type(errno_num, err_msg, err_filename)
1991 else:
FileNotFoundError: [Errno 2] No such file or directory: 'dot'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
Cell In[4], line 2
1 from qualtran.drawing import show_bloq
----> 2 show_bloq(do_nothing)
File [~/Qualtran/qualtran/drawing/_show_funcs.py:40](http://localhost:8889/lab/tree/tutorials/quantum-programming/qualtran/drawing/_show_funcs.py#line=39), in show_bloq(bloq, type)
38 type = type.lower()
39 if type == 'graph':
---> 40 show_bloq_graph(bloq)
41 elif type == 'dtype':
42 show_bloq_dtype_graph(bloq)
File [~/Qualtran/qualtran/drawing/_show_funcs.py:151](http://localhost:8889/lab/tree/tutorials/quantum-programming/qualtran/drawing/_show_funcs.py#line=150), in show_bloq_graph(bloq)
147 import IPython.display
149 from .graphviz import PrettyGraphDrawer
--> 151 IPython.display.display(PrettyGraphDrawer(bloq).get_svg())
File [~/Qualtran/qualtran/drawing/graphviz.py:369](http://localhost:8889/lab/tree/tutorials/quantum-programming/qualtran/drawing/graphviz.py#line=368), in GraphDrawer.get_svg(self)
367 def get_svg(self) -> IPython.display.SVG:
368 """Get an IPython SVG object displaying the graph."""
--> 369 return IPython.display.SVG(self.get_svg_bytes())
File [~/Qualtran/qualtran/drawing/graphviz.py:365](http://localhost:8889/lab/tree/tutorials/quantum-programming/qualtran/drawing/graphviz.py#line=364), in GraphDrawer.get_svg_bytes(self)
363 def get_svg_bytes(self) -> bytes:
364 """Get the SVG code (as bytes) for drawing the graph."""
--> 365 return self.get_graph().create(prog='dot', format='svg', encoding='utf-8')
File [~/Qualtran/.venv/lib/python3.14/site-packages/pydot/core.py:1833](http://localhost:8889/lab/tree/tutorials/quantum-programming/.venv/lib/python3.14/site-packages/pydot/core.py#line=1832), in Dot.create(self, prog, format, encoding)
1831 args = list(e.args) # type: ignore
1832 args[1] = f'"{prog}" not found in path.' # type: ignore
-> 1833 raise OSError(*args)
1834 else:
1835 raise
FileNotFoundError: [Errno 2] "dot" not found in path.
I've installed qualtran and dependencies from the repository. I'm using the latest version of jupyter-lab (4.6.6) from pip. I run into the same error when using vscode with jupyter extension.
Minimal code that produces the error:
from qualtran import BloqBuilder
from qualtran import QInt
from qualtran.drawing import show_bloq
# Start program construction
bb = BloqBuilder()
# Add input/output registers named 'x'
x = bb.add_register('x', QInt(8))
do_nothing = bb.finalize(x=x)
show_bloq(do_nothing)
- Dominant language
- Python
- Stars
- 397
- Forks
- 127
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quantumlib/Qualtran
-
Addition call_graph inconsistent with decomposition for registers with unequal bitsizesMay be free again @rupasri118 claimed this 67 days ago, and no pull request is open. Openkind/bug-report
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
quantumlib/Qualtran#1818 · 2 comments ·
-
`ReflectionUsingPrepare.adjoint()` returns `self` for non-real `global_phase`Possibly taken @doubleMcyber claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
quantumlib/Qualtran#2009 ·
-
Classical simulation fails for a QROAM with block size 1 on one axis: 0-bit `BQUInt` breaks `Partition`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 75/100
quantumlib/Qualtran#2008 ·
-
kickmix: `Circuit.reaction_depth()` materialises every op (≈ 135–170 B/op transient), limiting verifiable circuit sizePossibly taken @manwithacat claimed this 38 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
quantumlib/Qualtran#1993 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
quantumlib/Qualtran#1991 ·
All issues in quantumlib/Qualtran
Similar issues
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nolte/kamerplanter#3193 ·
Maintainers usually reply within 1 day
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day