Skip to content

Add benchmarking dir WIP#1518

Merged
TomerGoldfriend merged 29 commits intomainfrom
add_benchmarking_dir
Mar 25, 2026
Merged

Add benchmarking dir WIP#1518
TomerGoldfriend merged 29 commits intomainfrom
add_benchmarking_dir

Conversation

@TomerGoldfriend
Copy link
Copy Markdown
Member

PR Description

This PR adds a benchmarking directory, with an adder example.
This is still WIP

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 2026

🔥 New notebook just dropped!

@amir-naveh , @TomerGoldfriend — come check out this shiny new addition to our repo.

Copy link
Copy Markdown
Contributor

@classiqdor classiqdor left a comment

Choose a reason for hiding this comment

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

Sharing some thoughts regarding the notebook

Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/benchmark_adder/benchmark_adder.ipynb Outdated
Comment thread benchmarking/report/build_report/report.aux Outdated
Comment thread benchmarking/report/build_report/report.fdb_latexmk Outdated
Comment thread benchmarking/report/build_report/report.fls Outdated
Comment thread benchmarking/report/report.tex Outdated
Comment thread benchmarking/hardwares_preferences.py
Comment thread benchmarking/README.md Outdated
Comment thread benchmarking/README.md
Comment thread tests/notebooks/test_benchmark_adder.py Outdated
Comment thread benchmarking/benchmark.py
"""
pass

def show(self) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would have it as

Suggested change
def show(self) -> None:
def show(self, qprog: QuantumProgram | None) -> None:

So that if we called synthesize somewhere else, we could pass it here, and wouldn't have to call it again

Likewise, we could have a property of .qprog which will call synthesize once, thus accessing self.qprog instead of self.main in most parts of the code

Comment thread benchmarking/collector.py
if self.data_dir is None:
self.data_dir = str(p.parent)

async def reset_file(self) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An idea I just had: maybe we can have reset_file do "copy this file to this_file.old" and then create an empty file?
This way we'd have a little bit of a backup for the results

Comment thread benchmarking/collector.py
async with FILE_LOCK:
dump_results(self.filename, [])

def _append_error_log(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should also be async def and async with lock.
not sure, but I think it won't hurt

@@ -0,0 +1,349 @@
{
Copy link
Copy Markdown
Contributor

@classiqdor classiqdor Mar 19, 2026

Choose a reason for hiding this comment

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

maybe this can be a function? taking in example and returning filename?


Reply via ReviewNB

@@ -0,0 +1,349 @@
{
Copy link
Copy Markdown
Contributor

@classiqdor classiqdor Mar 19, 2026

Choose a reason for hiding this comment

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

maybe this can be aligned like a table. It's not important, but can be nice if this status is used a lot


Reply via ReviewNB

@@ -0,0 +1,409 @@
{
Copy link
Copy Markdown
Contributor

@classiqdor classiqdor Mar 19, 2026

Choose a reason for hiding this comment

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

Line #34.        async def submit(self, qprog: QuantumProgram) -> str:

this function is duplicate


Reply via ReviewNB

@@ -0,0 +1,360 @@
{
Copy link
Copy Markdown
Contributor

@classiqdor classiqdor Mar 19, 2026

Choose a reason for hiding this comment

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

Line #10.    from hardware import HardwareRunner

maybe we can put all the imports under a utils folder, and have a single line of from utils import BenchmarkExample, ResultCollector, HardwareRunner, HARDWARES


Reply via ReviewNB

@@ -0,0 +1,360 @@
{
Copy link
Copy Markdown
Contributor

@classiqdor classiqdor Mar 19, 2026

Choose a reason for hiding this comment

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

Line #1.    # How to construct main for a given number of qubits

the comment may not be needed


Reply via ReviewNB

@TomerGoldfriend TomerGoldfriend merged commit 20967c5 into main Mar 25, 2026
8 checks passed
@TomerGoldfriend TomerGoldfriend deleted the add_benchmarking_dir branch March 25, 2026 07:36
@github-actions
Copy link
Copy Markdown

🚀 Incredible, @TomerGoldfriend! You've merged your 67th PR! 🎯🎊

Your ongoing commitment to classiq-library is truly remarkable. You're a driving force in our community! 🚀
Your contributions are helping to shape the future of quantum computing! What exciting features or improvements do you envision next? 🔮

We are grateful for your dedication! 💫

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants