-
Notifications
You must be signed in to change notification settings - Fork 188
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
Demo on " Constant-depth preparation of matrix product states with dynamic circuits" #1185
Conversation
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
"dateOfPublication": "2024-09-10T00:00:00+00:00", | ||
"dateOfLastModification": "2024-09-10T00:00:00+00:00", |
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.
To do
Thank you for opening this pull request. You can find the built site at this link. Deployment Info:
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site. |
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.
This has turned out super nice, really well done @dwierichs
Just have some further, rather nitpicky but I think important points about the (very nice) illustrations and their positioning 🙃
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.
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.
Thank you, @dwierichs . I've left some comments and suggestions. Please let me know if there's something I can clarify or help with. Thanks.
Co-authored-by: Ivana Kurečić <[email protected]>
**Context:** On the level of mid-scale algorithms, it might be nice to differentiate between different "types" of wires, for example by coloring them differently, or giving them distinct line styles. As an example, in PennyLaneAI/qml#1185 on preparing matrix product states, there are auxiliary bond qubits and physical qubits, and coloring them differently would be a neat thing to do. **Description of the Change:** Update the output wire_options that could change the line style and color for circuit output. ```python @qml.qnode(qml.device("default.qubit")) def node(x): for w in range(5): qml.Hadamard(w) return qml.expval(qml.PauliZ(0) @ qml.PauliY(1)) # Make all wires cyan and bold, # except for wires 2 and 6, which are dashed and another color wire_options = {"color": "cyan", "linewidth": 5, 2: {"linestyle": "--", "color": "red"}, 6: {"linestyle": "--", "color": "orange"} } _,ax = qml.draw_mpl(node, wire_options=wire_options)(0.52) ``` **Benefits:** When complicated sates and quantum circuits diagram are created, wires could be marked with different selections. **Possible Drawbacks:** N/A **Related GitHub Issues:** #6165 --------- Co-authored-by: David Wierichs <[email protected]> Co-authored-by: ringo-but-quantum <> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: Christina Lee <[email protected]>
**Context:** On the level of mid-scale algorithms, it might be nice to differentiate between different "types" of wires, for example by coloring them differently, or giving them distinct line styles. As an example, in PennyLaneAI/qml#1185 on preparing matrix product states, there are auxiliary bond qubits and physical qubits, and coloring them differently would be a neat thing to do. **Description of the Change:** Update the output wire_options that could change the line style and color for circuit output. ```python @qml.qnode(qml.device("default.qubit")) def node(x): for w in range(5): qml.Hadamard(w) return qml.expval(qml.PauliZ(0) @ qml.PauliY(1)) # Make all wires cyan and bold, # except for wires 2 and 6, which are dashed and another color wire_options = {"color": "cyan", "linewidth": 5, 2: {"linestyle": "--", "color": "red"}, 6: {"linestyle": "--", "color": "orange"} } _,ax = qml.draw_mpl(node, wire_options=wire_options)(0.52) ``` **Benefits:** When complicated sates and quantum circuits diagram are created, wires could be marked with different selections. **Possible Drawbacks:** N/A **Related GitHub Issues:** #6165 --------- Co-authored-by: David Wierichs <[email protected]> Co-authored-by: ringo-but-quantum <> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: Christina Lee <[email protected]>
Title:
Constant-depth preparation of matrix product states with dynamic circuits
Summary:
Matrix product states (MPS) form an important class of quantum many-body states. Preparing them is an important subroutine for any algorithm that want to use MPS as an initial state, for example. A recent paper, on which this demo is based, and which it is following closely, generalized a method that reduces the depth of such a preparation circuit to constant scaling, by using auxiliary qubits and dynamic quantum circuits (mid-circuit measurements together with classical feedforward).
We here focus on the simplest scenario in the main text of the paper, and implement a simple example in code.
The implemented MPS has a parameter controlling the correlation length of the prepared state, which we verify explicitly.
Relevant references:
https://arxiv.org/pdf/2404.16083
https://arxiv.org/pdf/quant-ph/0501096
https://journals.aps.org/prxquantum/pdf/10.1103/PRXQuantum.4.020315
Possible Drawbacks:
Related GitHub Issues:
If you are writing a demonstration, please answer these questions to facilitate the marketing process.
GOALS — Why are we working on this now?
Mid-circuit measurements recently are/were a focus point in PennyLane. MPS states are used in some quantum chemistry algorithms as initial state.
AUDIENCE — Who is this for?
Researchers in quantum algorithms
KEYWORDS — What words should be included in the marketing post?
TBD
(more details here)
[sc-64275]