Skip to content

feat: Add MBQC benchmark programs#48

Draft
mark-koch wants to merge 1 commit into
mainfrom
feat/mbqc
Draft

feat: Add MBQC benchmark programs#48
mark-koch wants to merge 1 commit into
mainfrom
feat/mbqc

Conversation

@mark-koch

@mark-koch mark-koch commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Here is my take on the MBQC benchmark set. I took a subset of the standard benchmark circuits from https://github.com/meamy/feynman and converted them into an MBQC pattern using graphix which I then convert to jeff.

I wasn't entirely sure about the directory structure. Is it ok to put the code to generate the benchmarks into the _recipies directory?

case _:
raise NotImplementedError
assert isinstance(angle, float | int)
[jeff_angle] = self.add_op(jeff.const_float(angle * math.pi, 64)).outputs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Need to check if this radians conversion is correct

Comment on lines -1920 to +1930
params: list[float] = None,
params: list[JeffValue] = None,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by: Passing Python floats as params causes an error when encoding via capnproto. They should be jeff float values

@burgholzer

Copy link
Copy Markdown
Collaborator

Thanks for working on this @mark-koch 🙏🏼

Sorry for probably being the stupid one here, but none of these benchmarks are structured benchmarks or am I missing something?
The fact alone that they are expressed in OpenQASM 2 means that they almost cannot be.
The circuits do not even contain measurements, let alone conditionals conditioned on these measurements. I also do not see any kind of loops or branching in the files that I checked.
Could you clarify if that was intended?

@mark-koch

Copy link
Copy Markdown
Collaborator Author

The original circuits are flat, but the MBQC conversion introduces measurements and classical branches conditioned on mid-circuit measurement outcomes. If you load the jeff files you should see measurements and branches

@burgholzer

Copy link
Copy Markdown
Collaborator

The original circuits are flat, but the MBQC conversion introduces measurements and classical branches conditioned on mid-circuit measurement outcomes. If you load the jeff files you should see measurements and branches

Ah, I figured I must have been stupid.
It's a bit unfortunate that one cannot directly inspect the jeff programs as part of the PR review, because binary files cannot be displayed.
Maybe it would be worth to also store the human-readable version in some way...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants