Skip to content

Not-condition performance #4230

@ej-psi

Description

@ej-psi

Required prerequisites

  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.

Describe the feature

We're seeing some very common cases where the GPU state-vector sim is slower then our CPU sim, specifically because of not-conditions.

Application functions such as QROM and arithmetic often have "open-bubble" controls.

Image

In order to do this with CUDA-Q, we currently are required to insert X gates. For a large state vector (like above 30 qubits), the cost for all of these X gates is substantially more than the rest of the computation.

Here you can see the X gates inserted in the CUDA-Q program.

Image

As mentioned, this case is so common that we're seeing it make our GPU programs slower than the same programs on CPU.

Side note: For CNOT gates (only one control), CUDA-Q allows use of the ~qubit syntax for not-conditions, however this appears to insert X gates, and also doesn't seem to work for gates with 2 or more controls.

Implementing not-conditions without inserting X gates would increase the performance of all CUDA-Q programs which use high-level algorithms!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageMarks items that require a follow up for proper processingstale-notifiedStale notification has already fired for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions