Skip to content

Conversation

mtreinish
Copy link
Member

Summary

In preparation for providing a C API for building and interacting with circuits this commit removes the required Python component from the circuit construction APIs on CircuitData. After #13860 the only use case of Python in the circuit constructor is to manipulate a ParameterExpression global phase as ParameterExpression is still a Python only construct. This moves to using Python::with_gil() in those places only when it's needed. This gives us a path for building a circuit without the Python interpreter for the C API.

Details and comments

In preparation for providing a C API for building and interacting with
circuits this commit removes the required Python component from the
circuit construction APIs on CircuitData. After Qiskit#13860 the only use case
of Python in the circuit constructor is to manipulate a
ParameterExpression global phase as ParameterExpression is still a
Python only construct. This moves to using Python::with_gil() in those
places only when it's needed. This gives us a path for building a
circuit without the Python interpreter for the C API.
@mtreinish mtreinish added Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository C API Related to the C API labels Mar 10, 2025
@mtreinish mtreinish added this to the 2.1.0 milestone Mar 10, 2025
@mtreinish mtreinish requested a review from a team as a code owner March 10, 2025 22:56
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @levbishop

@coveralls
Copy link

coveralls commented Mar 10, 2025

Pull Request Test Coverage Report for Build 13820220898

Details

  • 76 of 76 (100.0%) changed or added relevant lines in 12 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.01%) to 88.131%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 94.69%
crates/qasm2/src/lex.rs 3 92.48%
Totals Coverage Status
Change from base Build 13819553093: 0.01%
Covered Lines: 72686
Relevant Lines: 82475

💛 - Coveralls

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

This looks like a nice start, it'll allow us to add C API functions to generate a circuit and add standard gates. I left one comment about copying below and another question is how we can allow circuit inspection; e.g. it would be nice if we can give index access to CircuitInstructions -- but these are very py-heavy right now 😅

self_.reserve(py, reserve);
self_.extend(py, data)?;
self_.reserve(reserve);
Python::with_gil(|py| -> PyResult<()> { self_.extend(py, data) })?;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we could also do this without the py token to enable copying circuits. What do you think about moving the with_gil inside extend in a way that we check if an instruction has parameter expressions and only then acquire the GIL? Maybe this has too much overhead and we can just wait for the Rust parameter expressions, too 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it here because extend() was being passed a Bound<PyAny> I can drop the py here and just use it from the bound.

Copy link
Member Author

@mtreinish mtreinish Mar 11, 2025

Choose a reason for hiding this comment

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

Fixed in 004b7b8 If we need to call extend() in a no python context we'll probably want to split the method into two variants, one for rust data types the other for python. We can save that for a follow up PR though.

Copy link
Contributor

Choose a reason for hiding this comment

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

The other, longer-term solution would be to wait until ParameterExpression is in Rust and have a clean Circuit - PyCircuit split, then extend would naturally be py-free. But I'm good as is for now 👍🏻

@@ -159,7 +158,7 @@ impl CircuitData {
qubit_indices: BitLocator::new(),
Copy link
Contributor

Choose a reason for hiding this comment

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

The BitLocator has a cached: OnceLock<Py<PyDict>>, can this become an issue at runtime or is this fine since there's no way we can populate the cache with Python objects?

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't be a problem we should only be initializing or working with the cached attribute when returning to python. There shouldn't be any code paths we access from cext where we could use this (or BitLocator more broadly tbh). We can refactor more if we do encounter issues though.

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

LGTM, I just have one question that can be answered in parallel: how expensive is a repetitive call to Py::with_gil compared to passing the py token? I'm thinking e.g. of a circuit construction where we have a parameterized global phase and repeatedly add to this phase.

@mtreinish
Copy link
Member Author

LGTM, I just have one question that can be answered in parallel: how expensive is a repetitive call to Py::with_gil compared to passing the py token? I'm thinking e.g. of a circuit construction where we have a parameterized global phase and repeatedly add to this phase.

There is definitely an overhead to this, with_gil is basically a no-op if you have the gil already, but there is still a check needed to determine that. The pyo3 docs call this out as a potential performance thing you can avoid by getting the py token from somewhere. I can run some benchmarks later to try and characterize this in real world numbers.

@mtreinish
Copy link
Member Author

I ran asv with this PR (rebased on current main) against main and this was the result:

Benchmarks that have improved:

| Change   | Before [9dcc668e] <no-py-token-constructor-path^2>   | After [36a93c28] <no-py-token-constructor-path>   |   Ratio | Benchmark (Parameter)                                                    |
|----------|------------------------------------------------------|---------------------------------------------------|---------|--------------------------------------------------------------------------|
| -        | 32.3±2μs                                             | 28.1±0.8μs                                        |    0.87 | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 2048) |

Benchmarks that have stayed the same:

| Change   | Before [9dcc668e] <no-py-token-constructor-path^2>   | After [36a93c28] <no-py-token-constructor-path>   | Ratio   | Benchmark (Parameter)                                                                                           |
|----------|------------------------------------------------------|---------------------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------|
|          | 91.5±2μs                                             | 112±60μs                                          | ~1.23   | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8192)                                        |
|          | 99.5±4μs                                             | 112±10μs                                          | ~1.12   | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8192)                                       |
|          | 306±10ms                                             | 277±2ms                                           | ~0.90   | utility_scale.UtilityScaleBenchmarks.time_qaoa('cz')                                                            |
|          | 11.7±2μs                                             | 9.96±0.4μs                                        | ~0.85   | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 128)                                         |
|          | 125±70μs                                             | 96.5±6μs                                          | ~0.77   | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8192)                                        |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 131072)                            |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 2048)                              |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 32768)                             |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8192)                              |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 131072)                           |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 32768)                            |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8192)                             |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 131072)                          |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 128)                                 |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 131072)                              |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 2048)                                |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 32768)                               |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8192)                                |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 131072)                           |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 32768)                            |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 131072)    |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 2048)      |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 32768)     |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8192)      |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 131072)   |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 32768)    |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8192)     |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 131072)  |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 128)         |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 131072)      |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 2048)        |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 32768)       |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8192)        |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 131072)   |
|          | n/a                                                  | n/a                                               | n/a     | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 32768)    |
|          | 0                                                    | 0                                                 | n/a     | utility_scale.UtilityScaleBenchmarks.track_bvlike_depth('cx')                                                   |
|          | 0                                                    | 0                                                 | n/a     | utility_scale.UtilityScaleBenchmarks.track_bvlike_depth('cz')                                                   |
|          | 0                                                    | 0                                                 | n/a     | utility_scale.UtilityScaleBenchmarks.track_bvlike_depth('ecr')                                                  |
|          | 29.3±1μs                                             | 31.6±1μs                                          | 1.08    | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 2048)                                        |
|          | 4.62±0.09ms                                          | 4.98±0.1ms                                        | 1.08    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8)                                |
|          | 20.1±0.5μs                                           | 21.4±0.6μs                                        | 1.06    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 128)                                       |
|          | 3.57±0.05ms                                          | 3.80±0.1ms                                        | 1.06    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 32768)                                    |
|          | 1.14±0.07ms                                          | 1.21±0.2ms                                        | 1.06    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(100, 50)                                    |
|          | 18.2±0.3ms                                           | 19.2±0.4ms                                        | 1.06    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 2048)     |
|          | 15.0±0.6μs                                           | 15.8±0.7μs                                        | 1.05    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 128)                                        |
|          | 910±8μs                                              | 958±20μs                                          | 1.05    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 32768)                                      |
|          | 35.0±0.8μs                                           | 36.6±0.5μs                                        | 1.05    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 128)                                      |
|          | 40.0±10ms                                            | 41.8±10ms                                         | 1.05    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(50, 150)                               |
|          | 4.84±0.06ms                                          | 5.06±0.1ms                                        | 1.05    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 128)                              |
|          | 21.1±0.2ms                                           | 22.1±0.5ms                                        | 1.05    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 2048)                             |
|          | 35.2±2ms                                             | 36.9±0.5ms                                        | 1.05    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8192)                             |
|          | 70.3±1ms                                             | 73.5±0.8ms                                        | 1.05    | utility_scale.UtilityScaleBenchmarks.time_bv_100('cx')                                                          |
|          | 102±2μs                                              | 106±2μs                                           | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8192)                                       |
|          | 30.0±0.6μs                                           | 31.1±0.7μs                                        | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 2048)                                        |
|          | 3.27±0.08ms                                          | 3.41±0.06ms                                       | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 32768)                                     |
|          | 214±2μs                                              | 223±3μs                                           | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 2048)                                     |
|          | 11.9±0.2ms                                           | 12.5±0.3ms                                        | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 131072)                                    |
|          | 831±20μs                                             | 864±10μs                                          | 1.04    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8192)                                      |
|          | 763±30μs                                             | 795±40μs                                          | 1.04    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(10, 150)                                    |
|          | 610±20μs                                             | 632±20μs                                          | 1.04    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(10, 50)                                     |
|          | 813±30μs                                             | 844±70μs                                          | 1.04    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(50, 50)                                     |
|          | 18.4±0.2ms                                           | 19.0±0.3ms                                        | 1.04    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 128)                              |
|          | 13.2±0.4μs                                           | 13.6±0.4μs                                        | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8)                                          |
|          | 17.0±0.2μs                                           | 17.4±0.2μs                                        | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8)                                        |
|          | 845±20μs                                             | 874±20μs                                          | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8192)                                     |
|          | 208±4μs                                              | 214±3μs                                           | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 2048)                                      |
|          | 25.5±0.3μs                                           | 26.1±0.3μs                                        | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 128)                                       |
|          | 12.1±0.2ms                                           | 12.5±0.2ms                                        | 1.03    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 131072)                                    |
|          | 18.3±0.2ms                                           | 18.9±0.09ms                                       | 1.03    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8)                                |
|          | 5.54±0.1μs                                           | 5.66±0.1μs                                        | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8)                                           |
|          | 12.0±0.3ms                                           | 12.2±0.3ms                                        | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 131072)                                    |
|          | 740±8μs                                              | 759±6μs                                           | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8192)                                      |
|          | 12.3±0.1ms                                           | 12.6±0.2ms                                        | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 131072)                                   |
|          | 858±20μs                                             | 877±20μs                                          | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8192)                                     |
|          | 215±6μs                                              | 220±5μs                                           | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 2048)                                      |
|          | 3.52±0.02ms                                          | 3.60±0.01ms                                       | 1.02    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 32768)                                     |
|          | 545±10μs                                             | 554±10μs                                          | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 128)                               |
|          | 301±3ms                                              | 306±2ms                                           | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 2048)                           |
|          | 374±2ms                                              | 382±0.6ms                                         | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 32768)                          |
|          | 316±3ms                                              | 322±2ms                                           | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8192)                           |
|          | 76.4±1ms                                             | 77.9±2ms                                          | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8)                               |
|          | 121±1μs                                              | 124±3μs                                           | 1.02    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8)                                   |
|          | 270±7μs                                              | 275±9μs                                           | 1.02    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8)           |
|          | 857±20ms                                             | 870±20ms                                          | 1.02    | utility_scale.UtilityScaleBenchmarks.time_circSU2('cx')                                                         |
|          | 860±10ms                                             | 876±10ms                                          | 1.02    | utility_scale.UtilityScaleBenchmarks.time_circSU2('ecr')                                                        |
|          | 629±8ms                                              | 640±20ms                                          | 1.02    | utility_scale.UtilityScaleBenchmarks.time_qv('cz')                                                              |
|          | 107±2ms                                              | 109±1ms                                           | 1.02    | utility_scale.UtilityScaleBenchmarks.time_square_heisenberg('ecr')                                              |
|          | 118±0.9ms                                            | 119±1ms                                           | 1.01    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 32768)                               |
|          | 7.21±0.3μs                                           | 7.25±0.2μs                                        | 1.01    | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 128)                                         |
|          | 8.03±0.2μs                                           | 8.15±0.2μs                                        | 1.01    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8)                                         |
|          | 3.55±0.08ms                                          | 3.59±0.03ms                                       | 1.01    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 32768)                                     |
|          | 844±30μs                                             | 856±30μs                                          | 1.01    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8192)                                      |
|          | 376±5μs                                              | 381±4μs                                           | 1.01    | circuit_construction.MultiControl.time_multi_control_circuit(16)                                                |
|          | 498±9μs                                              | 501±10μs                                          | 1.01    | circuit_construction.MultiControl.time_multi_control_circuit(20)                                                |
|          | 2.13±0.05ms                                          | 2.15±0.09ms                                       | 1.01    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(10, 50)                                |
|          | 13.2±1ms                                             | 13.4±1ms                                          | 1.01    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(50, 50)                                |
|          | 859±30μs                                             | 866±40μs                                          | 1.01    | circuit_construction.ParameterizedCirc.time_param_circSU2_100_build(16)                                         |
|          | 382±6μs                                              | 387±8μs                                           | 1.01    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8)                                 |
|          | 316±3ms                                              | 318±2ms                                           | 1.01    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8)                              |
|          | 78.1±0.7ms                                           | 79.2±1ms                                          | 1.01    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 2048)                            |
|          | 146±2ms                                              | 148±3ms                                           | 1.01    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 32768)                           |
|          | 817±9μs                                              | 829±10μs                                          | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8)         |
|          | 10.2±0.2ms                                           | 10.3±0.06ms                                       | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 128)      |
|          | 153±2ms                                              | 155±0.7ms                                         | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8)       |
|          | 198±2ms                                              | 199±2ms                                           | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8192)    |
|          | 38.9±0.4ms                                           | 39.3±0.5ms                                        | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 128)      |
|          | 37.9±0.2ms                                           | 38.1±0.7ms                                        | 1.01    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8)        |
|          | 74.9±0.6ms                                           | 75.4±1ms                                          | 1.01    | utility_scale.UtilityScaleBenchmarks.time_bv_100('cz')                                                          |
|          | 107±1ms                                              | 108±1ms                                           | 1.01    | utility_scale.UtilityScaleBenchmarks.time_square_heisenberg('cz')                                               |
|          | 122±0.3ms                                            | 121±0.8ms                                         | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 32768)                               |
|          | 30.9±0.4ms                                           | 30.8±0.3ms                                        | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8192)                                |
|          | 123±0.8ms                                            | 123±0.9ms                                         | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 32768)                               |
|          | 494±5ms                                              | 493±5ms                                           | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 131072)                              |
|          | 918±6μs                                              | 914±10μs                                          | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 32768)                                       |
|          | 36.4±0.5μs                                           | 36.2±0.8μs                                        | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 2048)                                       |
|          | 22.0±0.3μs                                           | 21.9±0.3μs                                        | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 128)                                       |
|          | 227±4μs                                              | 228±4μs                                           | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 2048)                                     |
|          | 3.62±0.05ms                                          | 3.62±0.08ms                                       | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 32768)                                    |
|          | 12.1±0.1ms                                           | 12.2±0.1ms                                        | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 131072)                                    |
|          | 10.0±0.06μs                                          | 10.1±0.1μs                                        | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8)                                         |
|          | 861±20μs                                             | 858±20μs                                          | 1.00    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8192)                                      |
|          | 976±20μs                                             | 976±40μs                                          | 1.00    | circuit_construction.CliffordSynthesis.time_clifford_synthesis(10)                                              |
|          | 26.2±0.5ms                                           | 26.2±0.6ms                                        | 1.00    | circuit_construction.CliffordSynthesis.time_clifford_synthesis(100)                                             |
|          | 5.88±0.09ms                                          | 5.89±0.05ms                                       | 1.00    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(10, 150)                               |
|          | 749±10μs                                             | 750±30μs                                          | 1.00    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(100, 10)                                    |
|          | 1.76±0.2ms                                           | 1.76±0.2ms                                        | 1.00    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(50, 150)                                    |
|          | 575±30μs                                             | 574±20μs                                          | 1.00    | circuit_construction.ParameterizedCirc.time_param_circSU2_100_build(10)                                         |
|          | 375±10μs                                             | 376±10μs                                          | 1.00    | circuit_construction.ParameterizedCirc.time_param_circSU2_100_build(5)                                          |
|          | 292±3ms                                              | 292±3ms                                           | 1.00    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 128)                            |
|          | 604±4ms                                              | 601±6ms                                           | 1.00    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 131072)                         |
|          | 7.36±0.2ms                                           | 7.32±0.3ms                                        | 1.00    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 2048)                             |
|          | 74.0±1ms                                             | 74.0±1ms                                          | 1.00    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 128)                             |
|          | 93.0±2ms                                             | 93.2±1ms                                          | 1.00    | circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8192)                            |
|          | 649±5ms                                              | 650±9ms                                           | 1.00    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 2048)   |
|          | 168±1ms                                              | 168±3ms                                           | 1.00    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 2048)    |
|          | 306±4ms                                              | 306±3ms                                           | 1.00    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 32768)   |
|          | 912±20ms                                             | 909±10ms                                          | 1.00    | circuit_construction.QasmImport.time_QV100_qasm2_import                                                         |
|          | 869±20ms                                             | 872±20ms                                          | 1.00    | utility_scale.UtilityScaleBenchmarks.time_circSU2('cz')                                                         |
|          | 8.88±0.1ms                                           | 8.90±0.1ms                                        | 1.00    | utility_scale.UtilityScaleBenchmarks.time_parse_qaoa_n100('cx')                                                 |
|          | 8.88±0.1ms                                           | 8.84±0.2ms                                        | 1.00    | utility_scale.UtilityScaleBenchmarks.time_parse_qaoa_n100('ecr')                                                |
|          | 30.9±0.3ms                                           | 30.9±0.4ms                                        | 1.00    | utility_scale.UtilityScaleBenchmarks.time_parse_square_heisenberg_n100('cx')                                    |
|          | 30.7±0.4ms                                           | 30.7±0.4ms                                        | 1.00    | utility_scale.UtilityScaleBenchmarks.time_parse_square_heisenberg_n100('cz')                                    |
|          | 30.7±0.3ms                                           | 30.6±0.6ms                                        | 1.00    | utility_scale.UtilityScaleBenchmarks.time_parse_square_heisenberg_n100('ecr')                                   |
|          | 524±5ms                                              | 523±8ms                                           | 1.00    | utility_scale.UtilityScaleBenchmarks.time_qv('cx')                                                              |
|          | 631±10ms                                             | 631±7ms                                           | 1.00    | utility_scale.UtilityScaleBenchmarks.time_qv('ecr')                                                             |
|          | 91.8±0.9ms                                           | 92.2±2ms                                          | 1.00    | utility_scale.UtilityScaleBenchmarks.time_square_heisenberg('cx')                                               |
|          | 387                                                  | 387                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_bv_100_depth('cx')                                                   |
|          | 402                                                  | 402                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_bv_100_depth('cz')                                                   |
|          | 406                                                  | 406                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_bv_100_depth('ecr')                                                  |
|          | 300                                                  | 300                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_circSU2_depth('cx')                                                  |
|          | 300                                                  | 300                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_circSU2_depth('cz')                                                  |
|          | 300                                                  | 300                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_circSU2_depth('ecr')                                                 |
|          | 1727                                                 | 1727                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qaoa_depth('cx')                                                     |
|          | 1734                                                 | 1734                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qaoa_depth('cz')                                                     |
|          | 1734                                                 | 1734                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qaoa_depth('ecr')                                                    |
|          | 1982                                                 | 1982                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qft_depth('cx')                                                      |
|          | 1982                                                 | 1982                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qft_depth('cz')                                                      |
|          | 1980                                                 | 1980                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qft_depth('ecr')                                                     |
|          | 2694                                                 | 2694                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qv_depth('cx')                                                       |
|          | 2694                                                 | 2694                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qv_depth('cz')                                                       |
|          | 2694                                                 | 2694                                              | 1.00    | utility_scale.UtilityScaleBenchmarks.track_qv_depth('ecr')                                                      |
|          | 558                                                  | 558                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_square_heisenberg_depth('cx')                                        |
|          | 558                                                  | 558                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_square_heisenberg_depth('cz')                                        |
|          | 558                                                  | 558                                               | 1.00    | utility_scale.UtilityScaleBenchmarks.track_square_heisenberg_depth('ecr')                                       |
|          | 471±1ms                                              | 465±5ms                                           | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 131072)                              |
|          | 7.57±0.1ms                                           | 7.48±0.07ms                                       | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 2048)                                |
|          | 29.7±0.3ms                                           | 29.4±0.4ms                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8192)                                |
|          | 140±3μs                                              | 138±3μs                                           | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8)                                  |
|          | 30.9±0.2ms                                           | 30.7±0.2ms                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8192)                               |
|          | 124±2ms                                              | 123±1ms                                           | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 32768)                              |
|          | 185±2μs                                              | 183±3μs                                           | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8)                                  |
|          | 124±1ms                                              | 122±0.7ms                                         | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 32768)                               |
|          | 2.63±0.06ms                                          | 2.60±0.03ms                                       | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 131072)                                      |
|          | 2.57±0.02ms                                          | 2.54±0.05ms                                       | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 131072)                                     |
|          | 10.7±1μs                                             | 10.6±0.6μs                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8)                                          |
|          | 2.54±0.04ms                                          | 2.52±0.02ms                                       | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 131072)                                     |
|          | 31.5±1μs                                             | 31.1±0.5μs                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 2048)                                        |
|          | 8.51±0.6μs                                           | 8.40±0.2μs                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8)                                           |
|          | 188±6μs                                              | 186±5μs                                           | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 2048)                                      |
|          | 8.74±0.05μs                                          | 8.66±0.3μs                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8)                                         |
|          | 24.6±0.6μs                                           | 24.4±0.3μs                                        | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 128)                                       |
|          | 3.63±0.1ms                                           | 3.62±0.08ms                                       | 0.99    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 32768)                                     |
|          | 228±3μs                                              | 226±1μs                                           | 0.99    | circuit_construction.MultiControl.time_multi_control_circuit(10)                                                |
|          | 646±20μs                                             | 637±40μs                                          | 0.99    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(10, 10)                                |
|          | 3.18±0.1ms                                           | 3.14±0.1ms                                        | 0.99    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(50, 10)                                |
|          | 627±20μs                                             | 621±30μs                                          | 0.99    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(50, 10)                                     |
|          | 1.31±0.01ms                                          | 1.30±0.04ms                                       | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 128)       |
|          | 626±6ms                                              | 622±6ms                                           | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 128)    |
|          | 1.23±0.01s                                           | 1.21±0.01s                                        | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 131072) |
|          | 805±10ms                                             | 797±8ms                                           | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 32768)  |
|          | 614±7ms                                              | 610±6ms                                           | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8)      |
|          | 717±10ms                                             | 710±9ms                                           | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8192)   |
|          | 9.95±0.05ms                                          | 9.89±0.09ms                                       | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8)        |
|          | 156±3ms                                              | 155±3ms                                           | 0.99    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 128)     |
|          | 76.2±0.6ms                                           | 75.4±0.6ms                                        | 0.99    | utility_scale.UtilityScaleBenchmarks.time_bv_100('ecr')                                                         |
|          | 8.93±0.1ms                                           | 8.82±0.1ms                                        | 0.99    | utility_scale.UtilityScaleBenchmarks.time_parse_qaoa_n100('cz')                                                 |
|          | 94.5±0.2ms                                           | 93.2±0.7ms                                        | 0.99    | utility_scale.UtilityScaleBenchmarks.time_parse_qft_n100('cx')                                                  |
|          | 95.3±0.6ms                                           | 94.2±0.6ms                                        | 0.99    | utility_scale.UtilityScaleBenchmarks.time_parse_qft_n100('cz')                                                  |
|          | 94.5±1ms                                             | 93.5±1ms                                          | 0.99    | utility_scale.UtilityScaleBenchmarks.time_parse_qft_n100('ecr')                                                 |
|          | 264±5ms                                              | 261±6ms                                           | 0.99    | utility_scale.UtilityScaleBenchmarks.time_qaoa('ecr')                                                           |
|          | 412±6ms                                              | 409±2ms                                           | 0.99    | utility_scale.UtilityScaleBenchmarks.time_qft('cx')                                                             |
|          | 541±10ms                                             | 534±5ms                                           | 0.99    | utility_scale.UtilityScaleBenchmarks.time_qft('ecr')                                                            |
|          | 490±10μs                                             | 478±7μs                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 128)                                 |
|          | 566±10μs                                             | 552±10μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 128)                                |
|          | 497±6ms                                              | 486±3ms                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 131072)                             |
|          | 7.85±0.07ms                                          | 7.71±0.1ms                                        | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 2048)                               |
|          | 124±0.9ms                                            | 121±0.7ms                                         | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 32768)                              |
|          | 531±4μs                                              | 521±7μs                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 128)                                 |
|          | 491±4ms                                              | 484±1ms                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 131072)                              |
|          | 7.73±0.1ms                                           | 7.61±0.1ms                                        | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 2048)                                |
|          | 52.4±0.2μs                                           | 51.2±1μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8)                                   |
|          | 648±10μs                                             | 636±10μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 128)                                |
|          | 498±6ms                                              | 487±7ms                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 131072)                             |
|          | 557±4μs                                              | 545±10μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 128)                                 |
|          | 7.87±0.05ms                                          | 7.72±0.09ms                                       | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 2048)                                |
|          | 30.9±0.8ms                                           | 30.2±0.05ms                                       | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8192)                                |
|          | 8.04±0.09ms                                          | 7.86±0.09ms                                       | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 2048)                                |
|          | 1.01±0.05ms                                          | 992±20μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 32768)                                       |
|          | 952±20μs                                             | 929±10μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 32768)                                      |
|          | 7.64±0.3μs                                           | 7.45±0.2μs                                        | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 128)                                         |
|          | 938±20μs                                             | 918±10μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 32768)                                       |
|          | 98.3±70μs                                            | 95.9±60μs                                         | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8192)                                        |
|          | 927±20μs                                             | 912±20μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 32768)                                       |
|          | 100±9μs                                              | 98.8±3μs                                          | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8192)                                        |
|          | 220±5μs                                              | 216±2μs                                           | 0.98    | circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 2048)                                      |
|          | 47.8±0.7μs                                           | 46.8±1μs                                          | 0.98    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(10, 10)                                     |
|          | 48.2±2ms                                             | 47.0±0.2ms                                        | 0.98    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 2048)     |
|          | 76.3±1ms                                             | 74.6±0.8ms                                        | 0.98    | circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8192)     |
|          | 7.89±0.5ms                                           | 7.75±0.2ms                                        | 0.98    | utility_scale.UtilityScaleBenchmarks.time_bvlike('ecr')                                                         |
|          | 206±3ms                                              | 201±1ms                                           | 0.98    | utility_scale.UtilityScaleBenchmarks.time_qaoa('cx')                                                            |
|          | 504±8ms                                              | 488±8ms                                           | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 131072)                              |
|          | 53.8±0.7μs                                           | 52.2±0.6μs                                        | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8)                                   |
|          | 31.6±0.6ms                                           | 30.6±0.1ms                                        | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8192)                                |
|          | 34.4±0.4μs                                           | 33.5±0.4μs                                        | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 2048)                                       |
|          | 8.91±0.3μs                                           | 8.68±0.1μs                                        | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 128)                                         |
|          | 2.62±0.07ms                                          | 2.54±0.02ms                                       | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 131072)                                      |
|          | 2.58±0.08ms                                          | 2.51±0.05ms                                       | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 131072)                                      |
|          | 12.6±0.5ms                                           | 12.3±0.3ms                                        | 0.97    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 131072)                                   |
|          | 5.29±0.2ms                                           | 5.15±0.1ms                                        | 0.97    | circuit_construction.CliffordSynthesis.time_clifford_synthesis(50)                                              |
|          | 3.45±0.2ms                                           | 3.35±0.2ms                                        | 0.97    | circuit_construction.ParamaterizedDifferentCircuit.time_QV100_build(100, 150)                                   |
|          | 8.09±0.09ms                                          | 7.78±0.1ms                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 2048)                               |
|          | 573±10μs                                             | 550±9μs                                           | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 128)                                 |
|          | 83.1±3μs                                             | 79.7±0.2μs                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8)                                   |
|          | 2.60±0.04ms                                          | 2.50±0.04ms                                       | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 131072)                                      |
|          | 6.04±0.1μs                                           | 5.82±0.3μs                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8)                                           |
|          | 7.41±0.4μs                                           | 7.08±0.3μs                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8)                                           |
|          | 30.1±0.8μs                                           | 29.0±0.2μs                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 128)                                      |
|          | 22.6±0.5μs                                           | 21.7±0.6μs                                        | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8)                                        |
|          | 12.9±0.1μs                                           | 12.4±0.06μs                                       | 0.96    | circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8)                                         |
|          | 8.86±0.5ms                                           | 8.48±0.2ms                                        | 0.96    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(100, 10)                               |
|          | 41.1±4ms                                             | 39.6±3ms                                          | 0.96    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(100, 50)                               |
|          | 537±10ms                                             | 519±7ms                                           | 0.96    | utility_scale.UtilityScaleBenchmarks.time_qft('cz')                                                             |
|          | 45.3±0.5μs                                           | 43.0±0.4μs                                        | 0.95    | circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8)                                   |
|          | 32.0±0.6ms                                           | 30.3±0.4ms                                        | 0.95    | circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8192)                               |
|          | 8.06±0.3ms                                           | 7.61±0.2ms                                        | 0.95    | utility_scale.UtilityScaleBenchmarks.time_bvlike('cx')                                                          |
|          | 8.12±0.2ms                                           | 7.72±0.1ms                                        | 0.95    | utility_scale.UtilityScaleBenchmarks.time_bvlike('cz')                                                          |
|          | 13.4±0.7μs                                           | 12.6±0.2μs                                        | 0.94    | circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 128)                                        |
|          | 123±30ms                                             | 114±30ms                                          | 0.93    | circuit_construction.ParamaterizedDifferentCircuit.time_DTC100_set_build(100, 150)                              |

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.

I'm not sure how reliable some of the numbers are TBH, for some of the benchmarks we're in a time scale where 5-6% is ~1 μs. I didn't run these on an idle system so other system noise can cause discrepencies like that. It's not showing any major regression though.

@Cryoris Cryoris added this pull request to the merge queue Mar 14, 2025
@Cryoris
Copy link
Contributor

Cryoris commented Mar 14, 2025

Thanks for running the benchmarks! Seems like it doesn't change much and it'll enable the C circuits 👍🏻 We'll get a clean py-token-flow again once we correctly split the Python interface off I guess, so any slow down would only be an intermediate state 🙂

Merged via the queue into Qiskit:main with commit 141b152 Mar 14, 2025
20 checks passed
raynelfss pushed a commit to raynelfss/qiskit that referenced this pull request Mar 20, 2025
* Remove Python dependency from circuit construction

In preparation for providing a C API for building and interacting with
circuits this commit removes the required Python component from the
circuit construction APIs on CircuitData. After Qiskit#13860 the only use case
of Python in the circuit constructor is to manipulate a
ParameterExpression global phase as ParameterExpression is still a
Python only construct. This moves to using Python::with_gil() in those
places only when it's needed. This gives us a path for building a
circuit without the Python interpreter for the C API.

* Remove with_gil for calling extend() in new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C API Related to the C API Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants