Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qubit specifier for POVM implementations #15

Closed
timmintam opened this issue May 7, 2024 · 2 comments · Fixed by #18
Closed

Qubit specifier for POVM implementations #15

timmintam opened this issue May 7, 2024 · 2 comments · Fixed by #18
Assignees
Labels
enhancement New feature or request

Comments

@timmintam
Copy link
Collaborator

So far, when we instantiate a POVMImplementation object, we set a number of qubits and assume that the POVM will act on all of the qubits of the circuit that will later be supplied.

Would it be interesting to be able to initialize POVMImplementation objects by specifying a subset of qubits to be measured (for instance as a sequence of QubitSpecifier or a list of integers) ?

@timmintam timmintam added the enhancement New feature or request label May 7, 2024
@timmintam timmintam self-assigned this May 7, 2024
@mrossinek
Copy link
Member

Yes, that's a very good point!

In fact, now that we require some part of transpilation to already have been completed, we should consider that a circuit may already be transpiled for a device's coupling map (i.e. span e.g. 127 qubits) while the actual circuit may only act on a subset of these. Without the proposed feature, we won't be able to tell the POVM which qubits to measure on (despite the fact that we won't be able to tell it not to randomize measurements over all 127 qubits).

@timmintam
Copy link
Collaborator Author

Yes!

Actually with the transpilation/routing PR #13, this specific case of circuit transpiled for a device's coupling map is already tackled and dealt within the povm_implementation.compose_circuits method:

def compose_circuits(self, circuit: QuantumCircuit) -> QuantumCircuit:
    
    ...
    
    if isinstance(circuit.layout, TranspileLayout):
        # Extract the final layout of the transpiled circuit (ancillas are filtered).
        index_layout = circuit.layout.final_index_layout(filter_ancillas=True)
    
    ...
    
    # Compose the two circuits with the correct routing.
    return circuit.compose(self.msmt_qc, qubits=index_layout)

Still we should generalize this and enable the option for the end user to specify on which qubits the POVM acts in general.

Question : once we enable this feature, should we keep this "under the hood" routing shown above or should we require the end user to take care of this routing for transpiled circuits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants