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

Fix for issue #213 #289

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/clifford_qnn/mnist_clifford_qnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def forward(self, x, use_qiskit=False):
self.q_device, self.encoder, self.q_layer, self.measure, x
)
else:
self.q_device = tq.QuantumDevice(n_wires=self.n_wires, bsz=bsz)
self.encoder(self.q_device, x)
self.q_layer(self.q_device)
x = self.measure(self.q_device)
Expand Down
1 change: 1 addition & 0 deletions torchquantum/operator/op_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..macro import C_DTYPE, F_DTYPE
from typing import Iterable, Union, List
from enum import IntEnum
from torchquantum.util.quantization.clifford_quantization import CliffordQuantizer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import necessary here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wait, I missed your initial comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you instead import this lazily, so in the conditional branch where we actually call CliffordQuantizer? Afterward, will merge in!


__all__ = [
"Operator",
Expand Down
Loading