Skip to content

Honor initial_layout when coupling map is None#5346

Merged
mergify[bot] merged 17 commits intoQiskit:masterfrom
1ucian0:5345
Nov 26, 2020
Merged

Honor initial_layout when coupling map is None#5346
mergify[bot] merged 17 commits intoQiskit:masterfrom
1ucian0:5345

Conversation

@1ucian0
Copy link
Copy Markdown
Member

@1ucian0 1ucian0 commented Nov 4, 2020

Fixes #5345

This PR embeds the layout when initial_layout is provided, even when coupling_map=None.

Additionally, it allows coupling_map=None in FullAncillaAllocation and CheckMap

@1ucian0 1ucian0 requested a review from a team as a code owner November 4, 2020 22:04
Comment on lines +197 to +198
transpiled = transpile(qc, initial_layout=[4, 2], optimization_level=level,
callback=self.callback)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what does transpiled look like here? is it a 2 qubit circuit or a 5 qubit circuit?

Copy link
Copy Markdown
Member Author

@1ucian0 1ucian0 Nov 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5, see line 202 and #5345 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think taking the max of the initial layout makes sense for these situations.

@ajavadia
Copy link
Copy Markdown
Member

ajavadia commented Nov 9, 2020

can you add a release note and a note to the initial_layout arg of transpile() which says if no coupling_map is given, then this just assigns the virtual qubits to the respective physical qubits.

@1ucian0
Copy link
Copy Markdown
Member Author

1ucian0 commented Nov 11, 2020

Release note added in 0a55275

@kdk kdk added Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. automerge labels Nov 25, 2020
@mergify mergify Bot merged commit 689f55f into Qiskit:master Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transpile(..., initial_layout=...) is ignored if there is no coupling map

4 participants