Replies: 14 comments 10 replies
-
|
Since #307 has been merged. We should focus on making This is what I have in mind. It assumes we are not storing targets, control, etc. |
Beta Was this translation helpful? Give feedback.
-
|
I remember some issues where you wanted to store |
Beta Was this translation helpful? Give feedback.
-
|
I think the template you wrote looks pretty good. Yes, I wanted a decomposition methods to be defined for each gate in the gate class, but that is a complicated API, since one gate can be decomposed into different basis gates (CNOT->iSWAP, CNOT->SWAP etc). I would suggest to add this later. I do remember at some point there was a problem with |
Beta Was this translation helpful? Give feedback.
-
|
I used |
Beta Was this translation helpful? Give feedback.
-
|
With #309 merged. We now need to focus on removing targets, controls from the I believe we should have the parametric gates as Gate factory (a function which takes in the parameters and returns a Gate class instead of an object instance). Once From the API perspective, @BoxiLi What's your opinion on this |
Beta Was this translation helpful? Give feedback.
-
|
I am not so familiar with this type of design. What will be the user interface if someone wants to define an RX gate withan angle pi? In many applications, it is common to repeatedly assign different angle values to the same Gate in a circuit. For instance, the Variational Quantum Algorithm (VQA). I feel like this will make the logic of parameter update very cumbersome? |
Beta Was this translation helpful? Give feedback.
-
|
Well the user interface would ideally be But throwing out a class for different parameters like in VQA would be inefficient and cumbersome. I will just leave Parameterized Gate it to be a standard class like how it is now and only remove the targets, classical controls. Also what's your opinion on making non-parametrized gates as |
Beta Was this translation helpful? Give feedback.
-
That is nice. Indeed, by itself, it does look quite elegant.
I think it is good. It will make the code cleaner for us, right? For users who want to define a custom gate. They can inherit from the meta class and then do whatever they want I assume. |
Beta Was this translation helpful? Give feedback.
-
|
With #316 merged. Let's focus on writing an abstract baseclass for @BoxiLi This is the class design I have in mind These classes are frozen so that they are hashable. For |
Beta Was this translation helpful? Give feedback.
-
|
@BoxiLi Not sure whether this is the right discussion tab as it is about gate refactoring. Is there a reason Could we may be shift it to its sole directory in root? This is the general practic for open source libraries e.g. quimb (https://github.com/jcmgray/quimb) Also currently the paper examples are not being tested in GitHub workflows because of a bug in .yaml. I am mostly done with gate refactoring, some minor changes left, so moving towards fixing and updating the documentation. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, we can move it to a separate directory.
|
Beta Was this translation helpful? Give feedback.
-
|
Shall I merge #317 ? |
Beta Was this translation helpful? Give feedback.
-
|
Originally, we put the paper code there just because we wanted it to be tested, together with the doc. You are right that doc is the place for the documentation. So indeed we should move it. Maybe it will also make sure that the paper code is properly tested and uptodate. |
Beta Was this translation helpful? Give feedback.
-
|
@BoxiLi Hi I have a different idea regarding how to manage Currently in #328 we are treating In order to simplify our class design and resolve the above, we could embed the
This will also simplify the gateclass design for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@BoxiLi I think we should iterate over our ideas for refactoring the Gate class (#263) in the Discussion tab for any contributor to follow them in the future. Since they will be spread between multiple Issues and PRs otherwise.
Beta Was this translation helpful? Give feedback.
All reactions