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

check user lattice name vs compiler lattice name #771

Merged

Conversation

lcapelluto
Copy link
Contributor

Give QPUCompiler an optional name attribute, use this when building QPUCompiler in get_qc. check against this name when compiling to binary.

…PUCompiler in get_qc. check against this name when compiling to binary.
@@ -160,6 +166,11 @@ def native_quil_to_executable(self, nq_program: Program) -> BinaryExecutableResp
"Program that hasn't been compiled via `quil_to_native_quil`. This is "
"ok if you've hand-compiled your program to our native gateset, "
"but be careful!")
if self.name is not None:
targeted_lattice = self.client.call('get_lattice_name')
if self.client.call('get_lattice_name') != self.name:
Copy link
Contributor

Choose a reason for hiding this comment

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

You might also want to guard this against the compiler server returning None. That's not a consideration for external users in their normal mode of operation, but internal users do also use pyQuil against local compiler-server instances. Otherwise (and pending action on the internal PR review), this looks fine to me.

@mpharrigan mpharrigan merged commit 470bf6e into rigetti:master Jan 24, 2019
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.

3 participants