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

Rework transpilation workflow #6

Open
JooNiv opened this issue Jan 9, 2025 · 1 comment
Open

Rework transpilation workflow #6

JooNiv opened this issue Jan 9, 2025 · 1 comment
Assignees
Labels
update An update to an existing feature or workflow
Milestone

Comments

@JooNiv
Copy link
Owner

JooNiv commented Jan 9, 2025

Rework how transpilation of the experiment circuits happens. Currently, all of the experiment circuits are separately transpiled. For multiple cuts in a large circuit, this will quickly become slow and unfeasible. A better way would be to transpile the circuits before operations from a qpd are inserted. The problem then becomes how to retain placeholder operations in the circuit through the transpilation. A custom transpiler could be a solution. Alternatively, if it is possible to insert the placeholder operations into the native operations the transpiler considers that could be a solution.

Solution:

Rename CutCircuit class to CutExperiment.
Define a new CutCircuit class that would house the subcircuit containing the placeholder operations before experiments are generated.
Additionally, the new CutCircuit also contains cut_locations and observables that can be passed to e.g. transpilation.
CutCircuit will also have a basis_gates field to determine later if qpd_combination gates need transpilation. This field will correspond to the basis gates of the backend if transpilation has been done or an empty list otherwise.

The new transpile function would take a CutCircuit and a backend and simply call:

qc2_transpiled = transpile(qc2, basis_gates=backend.configuration().basis_gates + [list of all placeholder gate names])

This will fully transpile the circuits without rolling placeholders.

Transpile fiction will then return a new CutCircuit object.

get_experiment_circuits() will be changed so that it takes a CutCircuit as an argument. Before inserting qpd_combinations will be decomposed to the basis_gates of passed CutCircuit.

@JooNiv JooNiv self-assigned this Jan 9, 2025
@JooNiv JooNiv added the update An update to an existing feature or workflow label Jan 9, 2025
@JooNiv JooNiv added this to the v1.0.0 milestone Jan 9, 2025
@JooNiv
Copy link
Owner Author

JooNiv commented Jan 14, 2025

Added initial versions of new CutCirucit and CutExperiment to work branch

@JooNiv JooNiv pinned this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update An update to an existing feature or workflow
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant