-
Notifications
You must be signed in to change notification settings - Fork 1
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
Introduce braket_client #30
Conversation
* initial aws_client commit * remove .idea * added amazon packages * Added functions to replace qasm gates and verbatim box * Modified qasm_convert_gates, added comments, removed topology argument * change aws test to randomnized clifford like the others. * added extras into installs and removed conditional classes * Added transpiler (and relevant inputs for transpiler), modified method of adding verbatim box * made poetry install all extras in unit_test.yml * remove module checks * updated tests * Added two function. 1. Transpile qasm to qasm using Qiskit, 2. Transpile qibo to braket circuit. Modified execute_circuit to only include inputs for verbatim_circuits and nshots. * Updated aws_client.py to sync with the latest aws_client.py residing in the "initial_setup" branch. --------- Co-authored-by: TL231 <[email protected]>
…cuits. Shifted docstring under __init__ to the class.
Contains instructions on how to get Phase RX gate, ZNE get_noisy_circuit to work in the notebook.
Previously, the qibo measurement gates will also be wrapped within the verbatim box if `verbatim_circuit = True`, raising an error. Solution: Create a copy of the input qibo circuit without measurement gates, extract qubit indices of measurements gates. Then convert to Braket and wrap verbatim box if needed. Finally, add the measurement gates back to the Braket circuit.
…d qasm transpilation, added job monitoring, moved transpilation args from init to transpilation func
Update qibo version & braket-sdk version
@mho291 you should not use
However, here you're talking about
Well, I can tell you that you should not do that, for the simple reason that the TOML file is like a So, you have to choose. Which one to choose is a separate story. But the usage of extras is consistent in
In any case, I don't see any residual conflict in the repo. So, it seems that you only have the conflicts and you never pushed them (which would be the correct thing to do). Please, refrain from using the web editor: if you're unable to solve conflicts locally, that's a good reason to dig deeper. Not to propagate them to remote repo through a different path. |
Thanks @alecandido , I have a better picture now. I noticed that we are 113 commits ahead of, 20 commits behind qiboteam/qibo-cloud-backends:main. So what I'm doing (currently still in progress) is to update the changes in accordance to the 20 commits we're behind. I've also included the Thanks a lot! |
To do this, I suggest to either do And yes, this will generate conflicts, which in general you will need to solve manually. And that's also the case for |
Super! Thanks so much for the guidance! |
pyproject.toml
Outdated
qiskit_ibm_provider = "^0.11" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qiskit_ibm_provider = "^0.11" | |
qiskit_ibm_provider = "^0.11" | |
amazon-braket-sdk = "^1.83.0" |
if in the docs you are running code examples with BraketClient
you probably need the amazon-braket-sdk
here as well, otherwise the docs deployment will fail.
@BrunoLiegiBastonLiegi I dismissed your review since it happened a while ago, so it made sense in general to confirm the opinion is unchanged. If you still believe that this is good to go, and you don't need to take a further look, feel free to approve it again. |
Hi! Wondering if we could expedite the merging of this. I have a few colleagues who will need to start using the cloud interface for their work in early November. Thank you!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I've been a little busy lately. This is still looking good to me, can you please just add the token
argument to the backend even though it's not used?
|
||
|
||
class BraketClientBackend(NumpyBackend): | ||
def __init__(self, device=None, verbatim_circuit=False, verbosity=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __init__(self, device=None, verbatim_circuit=False, verbosity=False): | |
def __init__(self, device=None, verbatim_circuit=False, verbosity=False, token: str=None): |
For symmetry with the other backends can you add a token=None
argument here, and raise a warning or an error if the user actually passes it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's a good idea to leave token
argument in just for symmetry with other cloud backends, because Braket doesn't need the token
argument. A user may be confused and wonder if there will be a feature for token
in future. What do you think? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that it may create some confusion, but I ultimately think that it would be better to uniform all the backends under the input arguments perspective. It should be fine, as long as this is well documented and/or warnings are raised for unused arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. In that case, I'm thinking we could raise a warning:
import warnings
def __init__(self, device=None, verbatim_circuit=False, verbosity=False, token: str=None):
if token:
warnings.warn(
f"Token is not needed for executing circuits on Amazon Braket devices.",
category=UserWarning
)
That way, the code can run even with token
present. Do you think this is alright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once more: refrain from warnings if you're not directly writing an app (i.e. a CLI or a graphical app).
Choose your favorite among:
- ignoring
- raise an error
- return some marker (possibly together with other values)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might choose ignore because raise_error
will stop the code from execution. But let me try all the options out on my end. Thanks a lot!
if token: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if token: | |
pass |
thanks, we could even drop this if we decide to ignore it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sure!
Thanks @mho291, I just checked that the braket tests are passing and they seem to (the errors come from the ibmq account in the secrets apparently). Personally I would merge this now as it looks good enough to me for the moment. We could iteratively improve on this in future with other PRs. |
Hi @BrunoLiegiBastonLiegi , sounds great! Thanks so much for guiding and reviewing. Once merged, I will also create an issue with the following to remind us of what we discussed earlier. Possibility of
The
|
Hi @BrunoLiegiBastonLiegi , since Braket client has been merged, is there a way to use it before the release? Thanks! :) |
You just clone the repo (main branch) and do |
Thanks very much!! |
No description provided.