Skip to content
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

Merged
merged 4 commits into from
Nov 14, 2023
Merged

Conversation

qtzhuang
Copy link
Contributor

  1. add AngleEmbedding
  2. add BasicEntangleLayer
  3. For supporting the above functions, add "add_gates" function in QuantumCircuit temporarily
  4. tests or example has been also added
  5. amplitude embedding will be added soon

Copy link
Collaborator

@Zhaoyilunnn Zhaoyilunnn left a 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

  1. using some tools like black to unity the coding style, this can easily avoid some minors like missing white spaces.
  2. 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"""
Copy link
Collaborator

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))
Copy link
Collaborator

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) ...

Copy link
Contributor Author

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~

@Zhaoyilunnn Zhaoyilunnn merged commit d175036 into ScQ-Cloud:master Nov 14, 2023
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants