amazon-braket / amazon-braket-examples Goto Github PK
View Code? Open in Web Editor NEWExample notebooks that show how to apply quantum computing with Amazon Braket.
Home Page: https://aws.amazon.com/braket/
License: Apache License 2.0
Example notebooks that show how to apply quantum computing with Amazon Braket.
Home Page: https://aws.amazon.com/braket/
License: Apache License 2.0
In the QPE Notebook under ./examples/advanced_circuits_algorithms/QPE/QPE.ipynb
, the description in "NUMERICAL TEST EXAMPLE 4" stated that
... the eigenstate
$|\Psi\rangle = |+\rangle \otimes |1\rangle = H|0\rangle \otimes Z|0\rangle$ .
IMHO, it should read
... the eigenstate
$|\Psi\rangle = |+\rangle \otimes |1\rangle = H|0\rangle \otimes X|0\rangle$ .
with the last gate being X instead of Z, as X|0> gives a |1> correctly (while Z|0> would give a |0>).
This is a documentation issue only. The code in the notebook is correctly using .x(query_qubits[1])
:
# State preparation for eigenstate |+,1> of U=X \otimes Z
query = Circuit().h(query_qubits[0]).x(query_qubits[1])
Is your feature request related to a problem? Please describe.
Customers want to organize Braket resources they create. For instance, they might want to group quantum tasks that belong to the same experiment and later retrieve them.
Describe the solution you'd like
An example notebook which should demonstrate:
Describe alternatives you've considered
We could put this in the Developer guide
Describe the bug
the Podman container build with
pip3 install quera_ahs_utils
assembles non-functioning AHS Braket library.
To Reproduce
When I run AHS emulation of a simple few atom system I see only 'ggggg..' state is being produced.
Also I see this warning:
/usr/local/lib/python3.10/dist-packages/braket/analog_hamiltonian_simulator/rydberg/rydberg_simulator_helpers.py:504: UserWarning: The solver uses intermediate time value that is larger than the maximum time value specified. The final time value of the specified range is used as an approximation.
Despite I used a lot of steps for a Hamiltonina which lasts for just 1.2 us
job = device.run(ahs_program, shots=shots, steps=480, solver_method="bdf")
Known workaround (if applicable)
I think it is related to the newer amazon-braket version. I have an old image build about 2 months ago which uses this this software stack and it has no problems - all my emulations work
$ pip3 list |grep braket
amazon-braket-default-simulator 1.14.0.post0
amazon-braket-schemas 1.17.0
amazon-braket-sdk 1.42.1
But when I build a fresh image, I get this software stack, for which AHS is producing only 'ggggg...' state.
amazon-braket-default-simulator 1.17.0
amazon-braket-schemas 1.18.0
amazon-braket-sdk 1.48.1
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Implementation Checklist (if applicable)
[ ] # issue_id
[ ] # issue_id
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
Attached example should submit, execute, and measure the cost of a hybrid job running on AWS and the QuEra QPU.
It encountered 3 problems:
with Tracker() as tracker:
full_task(device,ahs_prog,shots)
print('cost tracker, charge/$:',tracker.simulator_tasks_cost())
run against :
deviceArn='arn:aws:braket:us-east-1::device/qpu/quera/Aquila'
results with the output:
cost tracker, charge/$: 0
To Reproduce
python hybrid_submit.py
Expected behavior
there is no crash and the printed cost is 0.60 $
Known workaround (if applicable)
I can cut out get_drive(.) and get_counts(.) functions from the Amazon Braket Python SDK 'stable' version and place them in my code.
Our project needs to define a quantum convolutional layer. When implementing it, we choose to use tensorflow and tensorflow-quantum library. tensorflow-quantum is not installed by default under conda_braket environment. When pip install it, it seems there's a version conflict with cirq and an exception is thrown. However it is not easy to upgrade/downgrade cirq or tensorflow as they have dependencies with multiple other quantum libraries.
The problem can be reproduced on amazon braket notebooks
import tensorflow
import cirq
print(tensorflow.__version__) # 2.6.0
print(cirq.__version__) # 0.9.1
!pip install tensorflow-quantum
import tensorflow_quantum
When I run the following code using Amazon Braket SDK on my local ARM processor I get the error message: botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the CreateJob operation: This account is not authorized to use this resource. In order to access additional resources, please contact customer support.
input_file_path = "data/sonar.all-data"
from braket.jobs.config import InstanceConfig
from braket.aws import AwsSession
from braket.jobs.image_uris import Framework, retrieve_image
instance_config = InstanceConfig(instanceType='ml.p3.2xlarge')
hyperparameters={"nwires": "10",
"ndata": "64",
"batch_size": "64",
"epochs": "5",
"gamma": "0.99",
"lr": "0.1",
"seed": "42",
}
input_file_path = "data/sonar.all-data"
image_uri = retrieve_image(Framework.PL_PYTORCH, AwsSession().region)
import time
from braket.aws import AwsQuantumJob
job = AwsQuantumJob.create(
device="local:pennylane/lightning.gpu",
source_module="qml_script",
entry_point="qml_script.train_single",
job_name="qml-single-" + str(int(time.time())),
hyperparameters=hyperparameters,
input_data={"input-data": input_file_path},
instance_config=instance_config,
image_uri=image_uri,
wait_until_complete=False,
)
print(job.result())
The code was used from the following Amazon Braket example:
Could the error be related to insufficient quota for the ml.p3.2xlarge SageMaker Notebook instance?
Is your feature request related to a problem? Please describe.
amazon-braket-sdk-python supports parameterizing circuits but there is no example for how to use the feature.
Describe the solution you'd like
A notebook that shows how and when to use parameterized circuits.
Describe alternatives you've considered
Updating documentation in the Braket SDK
Implementation Checklist (if applicable)
N/A
Additional context
N/A
Describe the bug
Images not visible for below notebooks on github.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We should see images for circuits/graphs properly.
Screenshots
If applicable, add screenshots to help explain your problem.
System information (please complete the following information as applicable):
Additional context
Images are visible in notebook instance provided by Braket.
Currently you provide access to bitstrings from the measured final state of AHS evolution.
job = AwsQuantumTask(arn=task_arn, poll_timeout_seconds=30)
rawBitstr=job.result().get_counts()
For debugging purposes I'd like to have access to the CCD image from each shot
rawCCD_mages=job.result().????() --> shape [numShots, 1K,1K]
Some of the images are missing/broken link
Hi,
This 2 files allow me to execute a basic hybrid job against QuEra Aquila
https://bitbucket.org/balewski/quantummind/src/master/QuEra/python/toys/hybrid_submit.py
https://bitbucket.org/balewski/quantummind/src/master/QuEra/python/toys/hybrid_task.py
The hybrid job is executed on my laptop as follows:
python ./hybrid_submit.py
Can you please help me in upgrading them to achieve the following functionality and provide instruction to accomplish the following:
arn:aws:iam::765483381942:user/balewski
run_hybrid_task(nRepeat=4)
in hybrid_submit.pyThanks
Jan
Describe the bug
The link to the AllSinglesDoubles Pennylane documentation in the "Defining an ansatz circuit" section of the amazon-braket-examples/examples/pennylane/3_Hydrogen_Molecule_geometry_with_VQE/ notebook is broken. It should point to: https://docs.pennylane.ai/en/stable/code/api/pennylane.AllSinglesDoubles.html
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Open Pennylane documentation on the AllSinglesDoubles ansatz: https://docs.pennylane.ai/en/stable/code/api/pennylane.AllSinglesDoubles.html
In the D-Wave MaxCut example, an AwsDevice
is created in the 4th code block:
device = AwsDevice("arn:aws:braket:::device/qpu/d-wave/Advantage_system1")
However, device
is never used again in the notebook. Instead, the MaxCut problem is solved using a sampler object:
sampler = BraketDWaveSampler(s3_folder,'arn:aws:braket:::device/qpu/d-wave/Advantage_system1')
sampler = EmbeddingComposite(sampler)
response = sampler.sample_qubo(Q, chain_strength=chainstrength, num_reads=numruns)
Is this the only way to use the D-Wave devices and solve annealing problems? Or is it possible to use the device.run()
function? The run
function has the option of passing in a Problem
as the task specification (instead of a Circuit
), but I have so far been unable to get this to work.
Any help or directions to relevant tutorials would be greatly appreciated!
In PR #508 we moved functionality realized in ahs_utils.py to BDK.
The next step is to update all AHS examples, that utilze result.get_counts(), result.get_avg_density(), TimeSeries.from_lists() etc.
This will make the Jupyter notebooks more concise and more readable.
Is your feature request related to a problem? Please describe.
In this notebook, the term "cost" without a modifier is used several times in back-to-back cells to describe different things: the cost function one is trying to minimize, and the actual cost in dollars to the customer.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Need to explicitly call out which cost is being referred to in each plot, and in each call to the cost tracker. Change the axes for the evaluation of the cost function over iterations to say "cost function," and add a section header before the cost tracking calls to say something along the lines of "Tracking Customer Costs."
This is minor, but in the following example Jupyter notebook:
Under the "Aria" section, the first sentence states:
First, run we the QPE circuit on the Aria device with the maximum number of shots per task (5,000).
with a subsequent line of:
task = device.run(circ, shots=2500)
print(task)
A few things:
I recently had the opportunity to submit my first circuit on Oxford-Lucy via Braket, following a prior experiment on IonQ. I'm keen to analyze how the two compare. Could you guide me on how to access the transpiled circuit for Lucy from Braket? Given my original 7-qubit circuit's extensive connectivity and 30 entangling gates, I anticipate the Lucy version might be significantly longer due to the necessary swap operations. How can I retrieve this detailed information from Braket?
Furthermore, I'm looking for the latest specifications of Lucy, including T1, T2, the typical duration of entangling gates, readout fidelity per qubit, and any limitations on concurrent gate execution. Where might I find these details?
Thank you for your assistance.
I'm running Braket simulation locally on machines with 64 cores and ~420 GB of RAM. I can allocate 10 such nodes for few hours.
I'd like to be able to tell Braket:
Describe the bug
All of these links are broken:
https://github.com/aws/amazon-braket-examples/blob/main/examples/pennylane/0_Getting_started.ipynb
https://github.com/aws/amazon-braket-examples/blob/main/examples/pennylane/1_Parallelized_optimization_of_quantum_circuits.ipynb
https://github.com/aws/amazon-braket-examples/blob/main/examples/pennylane/2_Graph_optimization_with_QAOA.ipynb
https://github.com/aws/amazon-braket-examples/blob/main/examples/pennylane/3_Quantum_chemistry_with_VQE.ipynb
To Reproduce
Steps to reproduce the behavior:
Describe the bug
Executing the 2_Graph_optimization_with_QAOA notebook produces the following output for cell 13:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
See the notebook for the expected histogram.
Screenshots
If applicable, add screenshots to help explain your problem.
System information (please complete the following information as applicable):
Known workaround (if applicable)
Add a known workaround with steps to follow.
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
We don't yet have an explicit notebook demonstrating how to use the new cost tracker feature to set limits for cost in Hybrid Jobs.
Describe the solution you'd like
We need to create a notebook demonstrating how to do this.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
At least the max cut example [0] breaks during D-Wave maintenance windows due to the Advantage_system4 ARN being hardcoded. Should these use auto-selection?
While attempting to run the notebook 1_Running_quantum_circuits_on_simulators.ipynb
, I'm unable to load either the SV1 or TN1 devices. I receive the error:
>>> device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
# ...
# lots of error message that I can post if useful
# ...
EndpointConnectionError: Could not connect to the endpoint URL: "https://braket.us-east-2.amazonaws.com/device/arn%3Aaws%3Abraket%3A%3A%3Adevice%2Fquantum-simulator%2Famazon%2Fsv1"
and
>>> device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/tn1")
# ...
# lots of error message that I can post if useful
# ...
EndpointConnectionError: Could not connect to the endpoint URL: "https://braket.us-east-2.amazonaws.com/device/arn%3Aaws%3Abraket%3A%3A%3Adevice%2Fquantum-simulator%2Famazon%2Ftn1"
I notice the error URL is pointing to us-east-2
even though both the SV1 and TN1 devices are on us-east-1
and I'm running the notebook on an EC2 instance on us-east-1
.
The request to AWS Cost Explorer client asking for the cost of a job given by ARN returns 0$
To Reproduce
execute the script:
https://bitbucket.org/balewski/quantummind/src/master/QuEra/python/issues/issue2_cost_by_ARN.py
Expected behavior
for the day June 15 there should be a charge of about $1.5
I can see the job completed here:
https://us-east-1.console.aws.amazon.com/braket/home?region=us-east-1#/tasks/arn%3Aaws%3Abraket%3Aus-east-1%3A765483381942%3Aquantum-task%2F484a891b-828d-4127-9853-a447c09880ab
System information (please complete the following information as applicable):
$ pip3 list |grep braket
amazon-braket-default-simulator 1.15.0
amazon-braket-schemas 1.17.0
amazon-braket-sdk 1.42.1
Known workaround (if applicable)
read number of shots on the AWS web page and use calculator to compute the cost
The link to the Deep Dive into the anatomy of quantum circuits notebook is broken
ModuleNotFoundError: No module named 'pandas'
either add line to install or check conda_braket environment
For some analysis, say evaluation of stability of the HW, one needs to see the bistrings from all shots, presented as a list.
Currently you provide only the summary in the form of dictionary of all unique bistrings and the number of occurences. It is done by get_counts():
https://amazon-braket-sdk-python.readthedocs.io/en/latest/_modules/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.html#AnalogHamiltonianSimulationQuantumTaskResult.get_counts
Can you provide also new function get_shots(), which would differ very little from get_counts(), namely instead of accumulating the dictionary:
state_counts = Counter()
for shot in self.measurements:
...
state_counts.update((state,))
return dict(state_counts)
it would append a list:
state_list = []
for shot in self.measurements:
...
state_list.append(state)
return state_list
I can hack it for now, but this type of functionality is of general use. E.g. it is available in Qiskit or TKet.
Thanks, Jan
Hey there!
I managed to get my own container to work by downgrading my usual python version to 3.7.
I had an attempt to use python 3.8, but I failed. I manage to start from FROM 292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:1.0-cpu-py37-ubuntu18.04
, remove the present python installation and reinstall the version 3.8, but then from them CloudWatch I see that the main script is still called with python 3.7
Invoking script with the following command:
/usr/local/bin/python3.7 braket_container.py
While the libraries used in the docker the docker seems to, correctly, point to python 3.8
Error processing line 1 of /usr/local/lib/python3.8/site-packages/sphinxcontrib_serializinghtml-1.1.5-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site.py", line 168, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/importlib/__init__.py", line 51, in <module>
_w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
Anyway, before trying to debug what was going wrong in my docker could you confirm whether, currently, we need to run python3.7? Or are other versions supported?
Describe the bug
The "Getting_notifications_when_a_task_completes.ipynb" in folder "/examples/braket_features/Getting_notifications_when_a_task_completes" does not load the the github preview
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The notebook preview should display
Screenshots
If applicable, add screenshots to help explain your problem.
Describe the bug
Braket is not respecting my choice of measured qubits. It measures all 3 qubits and changes my order of measurement. This circuit produces: Counter({'110': 7, '000': 3}) , but it should produce : Counter({'01': 7, '00': 3})
qc_br = Circuit()
qc_br.h(0).cnot(0, 1).x(2).x(2)
qc_br.probability(target=[2,1])
To Reproduce
from braket.aws import AwsDevice
device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
from braket.circuits import Circuit
qc_br = Circuit()
qc_br.h(0).cnot(0, 1).x(2).x(2)
qc_br.probability(target=[1,2])
print(qc_br)
print('\nMeasured qubits:',qc_br._qubit_observable_mapping)
job = device.run(qc_br, shots=10)
jobRes=job.result()
print('M: counts',jobRes.measurement_counts)
Expected behavior
Counter({'01': 7, '00': 3})
System information (please complete the following information as applicable):
Ubuntu 22.04
core@a53c3c6fe9f2:$ pip3 list |grep bra$ python3 -V
amazon-braket-default-simulator 1.21.0
amazon-braket-schemas 1.20.2
amazon-braket-sdk 1.74.0
qbraid 0.5.3
core@a53c3c6fe9f2:
Python 3.10.12
Describe the bug
For a non-trivial atom geometry, AtomArrangementValidator throws error for no reason.
None of atoms in the register is closer than 4.8 um
The error reads:
error for AtomArrangementValidator
Sites [Decimal('0.0000167'), Decimal('0.0000282')] and site [Decimal('0.0000064'), Decimal('0.0000316')] have y-separation (0.0000034). It must either be exactly zero or not smaller than 0.000004 meters (type=value_error)
The code below proves the distance between those 2 sites is above 10um
a=np.array([0.0000167,0.0000282])
b=np.array([0.0000064,0.0000316])
d=a-b
dd=np.sqrt(np.sum(d**2))
print(a,b)
print('dV',d,'l=',dd)
OUTPUT:
[1.67e-05 2.82e-05] [6.40e-06 3.16e-05]
dV [ 1.03e-05 -3.40e-06] l= 1.0846658471621571e-05
To Reproduce
Steps to reproduce the behavior execute the following code
https://bitbucket.org/balewski/quantummind/src/master/QuEra/python/issues/issue3_atom_dist_crash.py
Alternatively, just use this definition of atom register in Braket
def placeAtoms():
posL=[[0.0, 0.0], [0.0, 5.7e-06], [0.0, 1.14e-05], [0.0, 1.71e-05], [0.0, 2.28e-05], [1.7613e-06, 2.82207e-05], [6.37317e-06, 3.157116e-05], [1.20726e-05, 3.157116e-05], [1.66839e-05, 2.82207e-05], [1.84452e-05, 2.28e-05], [1.84452e-05, 1.71e-05], [1.84452e-05, 1.14e-05], [1.84452e-05, 5.7e-06], [2.00919e-05, 3.16287e-05]]
atoms = AtomArrangement()
for x,y in posL: atoms.add([Decimal(x),Decimal(y)])
return atoms
Expected behavior
Aquila should accept this geometry as valid.
Is your feature request related to a problem? Please describe.
https://github.com/aws/amazon-braket-examples/blob/main/examples/pulse_control/3_Bell_pair_with_pulses_Rigetti.ipynb
This notebook uses hardcoded qubits:
a=10
b=113
This works for the topology of the current Rigetti devices, but it would be great if the notebook would work for any future Rigetti devices, as well.
Describe the solution you'd like
A random pair of connected qubits can be generated from a given device
as follows:
import numpy as np
connectivity = device.properties.paradigm.connectivity.connectivityGraph
qubit_a = np.random.choice(list(connectivity.keys()))
neighbors = connectivity[str(qubit)]
qubit_b = neighbors[np.random.randint(len(neighbors))]
Describe alternatives you've considered
When I submit Aquila job which requests more than 1k shots it is rejected by Braket.
Can you please bump up this limit to 5k or 10k? I run problems which require higher statistics than 1k shots.
This is the Braket error I see
Traceback (most recent call last):
File "/quera/problem_Z2Phase1D/./submit_Z2Phase_job.py", line 148, in <module>
job = device.run(discr_ahs_program, shots=shots)
File "/usr/local/lib/python3.10/dist-packages/braket/aws/aws_device.py", line 184, in run
return AwsQuantumTask.create(
File "/usr/local/lib/python3.10/dist-packages/braket/aws/aws_quantum_task.py", line 189, in create
return _create_internal(
File "/usr/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "/usr/local/lib/python3.10/dist-packages/braket/aws/aws_quantum_task.py", line 676, in _
task_arn = aws_session.create_quantum_task(**create_task_kwargs)
File "/usr/local/lib/python3.10/dist-packages/braket/aws/aws_session.py", line 230, in create_quantum_task
response = self.braket_client.create_quantum_task(**boto3_kwargs)
File "/usr/local/lib/python3.10/dist-packages/botocore/client.py", line 535, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.10/dist-packages/botocore/client.py", line 980, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the CreateQuantumTask operation: shots must be between #[1, 1000]
The following cell in quantum_anealing/Dwave_Factoring/Dwave_factoring.ipynb throws ValidationException
with error messages below.
sampleset = sampler_fixed_embedding.sample(bqm, num_reads=100)
print("Best solution found: \n",sampleset.first.sample)
---------------------------------------------------------------------------
ValidationException Traceback (most recent call last)
<ipython-input-54-656093bed65b> in <module>
----> 1 sampleset = sampler_fixed_embedding.sample(bqm, num_reads=100)
2 print("Best solution found: \n",sampleset.first.sample)
~/anaconda3/envs/Braket/lib/python3.7/site-packages/dwave/system/composites/embedding.py in sample(self, bqm, **parameters)
501 self._fix_embedding(embedding)
502
--> 503 return super(LazyFixedEmbeddingComposite, self).sample(bqm, **parameters)
504
505
~/anaconda3/envs/Braket/lib/python3.7/site-packages/dwave/system/composites/embedding.py in sample(self, bqm, chain_strength, chain_break_method, chain_break_fraction, embedding_parameters, return_embedding, warnings, **parameters)
277 parameters['ignored_interactions'] = ignored
278
--> 279 response = child.sample(bqm_embedded, **parameters)
280
281 def async_unembed(response):
~/anaconda3/envs/Braket/lib/python3.7/site-packages/dimod/core/sampler.py in sample(self, bqm, **parameters)
169 # sample_qubo is implemented
170 Q, offset = bqm.to_qubo()
--> 171 sampleset = self.sample_qubo(Q, **parameters)
172 else:
173 h, J, offset = bqm.to_ising()
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/ocean_plugin/braket_dwave_sampler.py in sample_qubo(self, Q, **kwargs)
207 {0: 1, 4: 0}
208 """
--> 209 return super().sample_qubo(Q, **kwargs)
210
211 def sample_qubo_quantum_task(self, Q: Dict[Tuple[int, int], int], **kwargs) -> QuantumTask:
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/ocean_plugin/braket_sampler.py in sample_qubo(self, Q, **kwargs)
281 {0: 1, 4: 0}
282 """
--> 283 aws_task = self.sample_qubo_quantum_task(Q, **kwargs)
284 variables = set().union(*Q)
285 return BraketSampler.get_task_sample_set(aws_task, variables)
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/ocean_plugin/braket_dwave_sampler.py in sample_qubo_quantum_task(self, Q, **kwargs)
237 {0: 1, 4: 0}
238 """
--> 239 return super().sample_qubo_quantum_task(Q, **kwargs)
240
241 def _process_solver_kwargs(self, **kwargs) -> Dict[str, Any]:
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/ocean_plugin/braket_sampler.py in sample_qubo_quantum_task(self, Q, **kwargs)
340 self._s3_destination_folder,
341 logger=self._logger,
--> 342 **solver_kwargs,
343 )
344
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/aws/aws_device.py in run(self, task_specification, s3_destination_folder, shots, poll_timeout_seconds, poll_interval_seconds, *aws_quantum_task_args, **aws_quantum_task_kwargs)
147 poll_interval_seconds=poll_interval_seconds,
148 *aws_quantum_task_args,
--> 149 **aws_quantum_task_kwargs,
150 )
151
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/aws/aws_quantum_task.py in create(aws_session, device_arn, task_specification, s3_destination_folder, shots, device_parameters, disable_qubit_rewiring, tags, *args, **kwargs)
130 disable_qubit_rewiring,
131 *args,
--> 132 **kwargs,
133 )
134
~/anaconda3/envs/Braket/lib/python3.7/functools.py in wrapper(*args, **kw)
838 '1 positional argument')
839
--> 840 return dispatch(args[0].__class__)(*args, **kw)
841
842 funcname = getattr(func, '__name__', 'singledispatch function')
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/aws/aws_quantum_task.py in _(problem, aws_session, create_task_kwargs, device_arn, device_parameters, disable_qubit_rewiring, *args, **kwargs)
448 )
449
--> 450 task_arn = aws_session.create_quantum_task(**create_task_kwargs)
451 return AwsQuantumTask(task_arn, aws_session, *args, **kwargs)
452
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/aws/aws_session.py in create_quantum_task(self, **boto3_kwargs)
90 str: The ARN of the quantum task.
91 """
---> 92 response = self.braket_client.create_quantum_task(**boto3_kwargs)
93 return response["quantumTaskArn"]
94
~/anaconda3/envs/Braket/lib/python3.7/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
314 "%s() only accepts keyword arguments." % py_operation_name)
315 # The "self" in this scope is referring to the BaseClient.
--> 316 return self._make_api_call(operation_name, kwargs)
317
318 _api_call.__name__ = str(py_operation_name)
~/anaconda3/envs/Braket/lib/python3.7/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
633 error_code = parsed_response.get("Error", {}).get("Code")
634 error_class = self.exceptions.from_code(error_code)
--> 635 raise error_class(parsed_response, operation_name)
636 else:
637 return parsed_response
ValidationException: An error occurred (ValidationException) when calling the CreateQuantumTask operation: The field deviceParameters does not match the expected schema for the selected device. Please refer to the github repo amazon-braket-schemas-python for examples
I did not change any parts except for a bucket name and its prefix. A region I am using is us-west-2.
Currently, the VQE Chemistry example notebook uses FreeParameter
in the notebook. The SDK in notebooks uses an older version than where FreeParameter
occurs. Long term fix is being worked on internally.
Short term fix:
under the Imports and setup cell, you can change it to read::
# create a directory named "data" to store intermediate classical computation results from OpenFermion
!mkdir -p "data"
!pip install amazon-braket-sdk==1.17.0
!pip show amazon-braket-sdk
Describe the bug
The Dwave_StructuralImbalance and Dwave_factoring notebooks fail with the error:
ImportError: cannot import name 'Markup' from 'jinja2'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Cell 12 should produce an image rendered using Bokeh
Screenshots
If applicable, add screenshots to help explain your problem.
System information (please complete the following information as applicable):
Known workaround (if applicable)
Pin Jinja2 version to 3.0.3. This can be accomplished by including the following command at the top of the notebook:
!pip install Jinja2==3.0.3
Additional context
Starting with version 3.1.0 Jinja2 dropped support for importing Markup. See changelog here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.