Skip to content

Conversation

idavis
Copy link
Collaborator

@idavis idavis commented Jun 16, 2025

In the original implementation of the OpenQASM compiler, gates with implicit modifiers needed to be specially handled by redefining them as their unmodiefied variants and collecting the modifier. For example, ch would be converted to h with a ctrl(1) modifier and would be used to build up the gate call with the additional explicit modifiers.

With the introduction of the Std.OpenQASM library, we can now call those gates directly without needing to decompose them. This also cleans up error messages as any errors would have been associated with the unmodified gate name prior.

@idavis idavis requested a review from orpuente-MS June 16, 2025 16:13
@idavis idavis self-assigned this Jun 16, 2025
Copy link

Change in memory usage detected by benchmark.

Memory Report for 1d271ac

Test This Branch On Main Difference
compile core + standard lib 25683854 bytes 25440502 bytes 243352 bytes

@idavis idavis requested a review from billti as a code owner June 16, 2025 16:37
Copy link

Change in memory usage detected by benchmark.

Memory Report for 00d508e

Test This Branch On Main Difference
compile core + standard lib 25683854 bytes 25440502 bytes 243352 bytes

@idavis idavis force-pushed the iadavis/remove-implicit-modifiers branch from d1c05f2 to b355817 Compare June 16, 2025 16:51
Copy link

Change in memory usage detected by benchmark.

Memory Report for 41c9c27

Test This Branch On Main Difference
compile core + standard lib 25683854 bytes 25440502 bytes 243352 bytes

@idavis idavis changed the title Remove implicit modifier handling Remove implicit modifier handling during OpenQASM lowering Jun 16, 2025
@DmitryVasilevsky
Copy link
Contributor

Library changes look good. Approving library part.

Copy link

Change in memory usage detected by benchmark.

Memory Report for c93cd74

Test This Branch On Main Difference
compile core + standard lib 25677846 bytes 25440502 bytes 237344 bytes

@idavis idavis added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 4f32399 Jun 16, 2025
18 checks passed
@idavis idavis deleted the iadavis/remove-implicit-modifiers branch June 16, 2025 21:56
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.

3 participants