-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add some pre-build funtions and tests #111
Conversation
qtzhuang
commented
Nov 14, 2023
- add AngleEmbedding
- add BasicEntangleLayer
- For supporting the above functions, add "add_gates" function in QuantumCircuit temporarily
- tests or example has been also added
- amplitude embedding will be added soon
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.
Thanks for the great work. In general this PR looks good to me, future improvements may include
- using some tools like black to unity the coding style, this can easily avoid some minors like missing white spaces.
- refer to pennylane or other opensource projects and read their unit tests, figuring out how they write ut for circuit templates and improve our ut.
rotation(str): one-parameter single-qubit gate to use | ||
""" | ||
weights = np.asarray(weights) | ||
"""convert weights to numpy array if weights is list otherwise keep unchanged""" |
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.
minor: inline comments should start with "#"
|
||
elif self.num_qubits > 2: | ||
for i in range(self.num_qubits): | ||
gate_list.append(qeg.CXGate(i,(i+1)%self.num_qubits)) |
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.
missing space between i
and (i+1) ...
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.
thanks~,I humbly accept the above suggestions and make better work~