amazon-braket / amazon-braket-examples

Example notebooks that show how to apply quantum computing with Amazon Braket.
https://aws.amazon.com/braket/
Apache License 2.0
476 stars 226 forks source link

feature: Parameterized circuit example #158

Closed wrasmuss closed 1 year ago

wrasmuss commented 2 years ago

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

christianbmadsen commented 2 years ago

@wrasmuss we do have an example of how to use parametrized circuits here: https://github.com/aws/amazon-braket-examples/blob/main/examples/hybrid_quantum_algorithms/VQE_Chemistry/VQE_chemistry_braket.ipynb. Would it help if we made an example under the braket_features folder instead? Thanks!

wrasmuss commented 2 years ago

Searching this repo for FreeParameter doesn't seem to yield any hits. Maybe I'm doing something wrong. Parameter gets a lot of hits but it's too many to sort through. Having a notebook under features specifically for parameterized circuits might help users find the feature, but maybe we could address the feature through helping users find the existing example via keywords or something.

christianbmadsen commented 2 years ago

@wrasmuss A more reliable way to search is to clone the repository and search with grep from a console. So in this case you could do something like this from a terminal:

$ git clone https://github.com/aws/amazon-braket-examples.git
Cloning into 'amazon-braket-examples'...
remote: Enumerating objects: 2473, done.
remote: Counting objects: 100% (277/277), done.
remote: Compressing objects: 100% (193/193), done.
remote: Total 2473 (delta 103), reused 240 (delta 82), pack-reused 2196
Receiving objects: 100% (2473/2473), 57.50 MiB | 11.20 MiB/s, done.
Resolving deltas: 100% (1331/1331), done.
$ grep -r FreeParameter amazon-braket-examples/*
amazon-braket-examples/examples/hybrid_quantum_algorithms/VQE_Chemistry/VQE_chemistry_braket.ipynb:    "from braket.circuits import Circuit, FreeParameter, observables\n",

That said it's a good suggestion that this feature (and similar small features) should be easier to discover by way of examples and/or our other documentation, such as the developer guide.

kshyatt-aws commented 1 year ago

Hasn't this been addressed by AG launch?

speller26 commented 1 year ago

There are several examples that use FreeParameters, including the AG example; closing.