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

Automatic multizone routing #48

Merged
merged 15 commits into from
Sep 28, 2023
Merged

Automatic multizone routing #48

merged 15 commits into from
Sep 28, 2023

Conversation

trvto
Copy link
Collaborator

@trvto trvto commented Sep 20, 2023

Add simple automatic circuit routing for the aqt_multi_zone backend

@@ -4,7 +4,7 @@
from dataclasses import dataclass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some of the files are missing the "# Copyright 2020-2023 Cambridge Quantum Computing" note at the beginning. Can you please add that?

pytket/extensions/aqt/backends/aqt_multi_zone.py Outdated Show resolved Hide resolved
@trvto trvto requested a review from cqc-melf September 22, 2023 12:11
Copy link
Collaborator

@cqc-melf cqc-melf left a comment

Choose a reason for hiding this comment

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

Thank you for the update, one more question.

@@ -366,6 +380,26 @@ def copy(self) -> "MultiZoneCircuit":
new_circuit.multi_zone_operations = deepcopy(self.multi_zone_operations)
return new_circuit

def get_n_shuttles(self) -> int:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were are this two functions used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just there for characterization of circuit after compilation. I added some test code for it.

count += 1
return count

def get_n_pswaps(self) -> int:
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just there for characterization of circuit after compilation. I added some test code for it.

@trvto
Copy link
Collaborator Author

trvto commented Sep 22, 2023

Also added docstrings for the get_n_... functions

@trvto trvto requested a review from cqc-melf September 22, 2023 14:52
@@ -141,3 +139,28 @@ def get_zone_max_ions(self, zone_index: int) -> int:
zone = self.zones[zone_index]
zone_type = self.zone_types[zone.zone_type_id]
return zone_type.max_ions

def __str__(self) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this tested somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm using it in a jupyter notebook. Added test that it, in fact returns a string. But not sure if it makes sense to test the exact content of the string at the moment.

@trvto trvto requested a review from cqc-melf September 27, 2023 14:28
@trvto trvto merged commit c8b37a0 into develop Sep 28, 2023
15 checks passed
trvto added a commit that referenced this pull request Oct 17, 2023
* implement initial routing

* allow custom initial placement

* remove not implemented

* add documentation

* review suggestions

* better documentation of move_qubit

* test get_n_shuttles and get_n_pswaps

* docstring for  get_n_shuttles and get_n_pswaps

* Allow generate AQT syntax directly from pytket circuit

* refactor architecture class, add print function and another named architecture

* add docstring

* add test for architecture string, add copyright notices in test files

* update changelog

* use equivalent definition of diamond pattern arch
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

Successfully merging this pull request may close these issues.

2 participants