amazon-braket / amazon-braket/Braket.jl

Incorrect Handling of Mid-Circuit Measurements in IR Function

Aberta
#99 1 comentário 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Julia
Estrelas
110
Forks
7
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**Describe the bug**
When mid-circuit measurements are included in a quantum circuit, the `ir` function fails to recognize these measurements correctly. The function erroneously adds measurements to all qubits in the circuit.

**To reproduce**
1. Create a quantum circuit that includes mid-circuit measurements on specific qubits.
2. Generate the intermediate representation (IR) of the circuit using the `ir` function.
3. Inspect the output of the IR to check the measurements.
4. Observe that measurements have been added to all qubits instead of only the specified ones.

**Expected behavior**
I expected the `ir` function to accurately reflect the mid-circuit measurements as defined in the original quantum circuit.
Midcircuit measurements should not be moved to the end of the circuit.

**Screenshots or logs**
![image](https://github.com/user-attachments/assets/4f6f05c3-3929-4646-9007-9b3de4f464e9)

**System information**
- **Julia version**: 1.10
- **Braket.jl version**: Main Branch

**Note**
Instead of using the Reset Instruction, I am currently using Z.
The idea, is that after a measurement, the qubit is reset and reused for a different computation

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.