Skip to content

Update TwoQubitBasisDecomposer to avoid sentintel string #14418

@mtreinish

Description

@mtreinish

What should we add?

The root cause of #14413 is that the TwoQubitBasisDecomposer struct set the basis_gate_name attribute uses a sentintel value USER_GATE instead of the actual gate name. The decomposer was written before we had the concept of gates in Rust and this was a workaround to support all the gates because they were opaque to rust (CX was special because we have special handling for cx deocmpositon in the decomposer). However, now that we have gates in rust there is no reason to do this because we can just handle the circuit construction directly in Rust without using a sentinel value to map to the python defined object. We should update the decomposer logic to handle this directly and avoid a source of bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RustThis PR or issue is related to Rust code in the repositorysynthesistype: feature requestNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions