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

Cost function using virtual qubits #54

Open
miamico opened this issue Oct 27, 2022 · 0 comments
Open

Cost function using virtual qubits #54

miamico opened this issue Oct 27, 2022 · 0 comments

Comments

@miamico
Copy link

miamico commented Oct 27, 2022

When trying to get the error for qubits used by the CX gate the code below assumes that the layout is virtual and it will raise errors with certain layouts for physical qubits.

https://github.com/qiskit-research/qiskit-research/blob/f4c1fe929d1e865a7c01fc85f85207a3a966aaff/qiskit_research/utils/cost_funcs.py#L54

The correct version would be:

fid *= (1-props.gate_error('cx', [layout[q0], layout[q1]]))

where layout is one of the matching layouts for the circuit. this is how it is handled in the original cost function code in mapomatic: https://github.com/Qiskit-Partners/mapomatic/blob/965ad30f20482fc14984cde371d5e1ab6b8335db/mapomatic/layouts.py#L210

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

No branches or pull requests

1 participant