-
Notifications
You must be signed in to change notification settings - Fork 575
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
[TAPE] Adds circuit drawing functionality to the quantum tape #824
Conversation
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
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.
Looks good @josh146. Just a few smaller comments/questions. So, for my own understanding, this simply connects the new quantum tape to the already existing circuit-drawer in circuit_graph.py
?
self._operations = ops | ||
self._observables = obs |
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.
ops
and obs
are easily confused. 😆
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.
They are, but I didn't want to alter the signature while still inheriting from the old circuit graph! Something to keep in mind when we decide to drop backcompatibility
for m in self._observables: | ||
if m.return_type is qml.operation.State: | ||
# state measurements are applied to all device wires | ||
m._wires = wires # pylint: disable=protected-access |
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.
Does this have something to do with allowing state measurements to be applied without declaring on which wires?
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.
Yep! exactly
@@ -467,7 +511,7 @@ def to_tf(self, dtype=None): | |||
output. If not provided, the default is ``tf.float64``. | |||
|
|||
Raises: | |||
qml.QuantumFunctionError: if TensorFlow >= 2.1 is not installed | |||
.QuantumFunctionError: if TensorFlow >= 2.1 is not installed |
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.
Is this usually how it's written? 🤔
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 think this was originally written by another contributor (and was copied from the old core), but I quite like how it avoids the redundancy of saying "raises a QuantumFunctionError if TensorFlow >= 2.1 is not installed".
Co-authored-by: Theodor <theodor@xanadu.ai>
No description provided.