diff --git a/README.md b/README.md index a68f6f00..433956fa 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,11 @@ Researchers on quantum algorithm design, parameterized quantum circuit training, Dynamic computation graph, automatic gradient computation, fast GPU support, batch model tensorized processing. ## News +- Torchquantum is used in the winning team for ACM Quantum Computing for Drug Discovery Challenge. +- Torchquantum is highlighted in [UnitaryHack](https://unitaryhack.dev/projects/torchquantum/). +- TorchQuantum received [UnitaryFund](https://unitary.fund/). +- TorchQuantum is integrated to [IBM Qiskit Ecosystem](https://qiskit.github.io/ecosystem/). +- TorchQuantum is integrated to [PyTorch Ecosystem](https://pytorch.org/ecosystem/). - v0.1.8 Available! - Check the [dev branch](https://github.com/mit-han-lab/torchquantum/tree/dev) for new latest features on quantum layers and quantum algorithms. - Join our [Slack](https://join.slack.com/t/torchquantum/shared_invite/zt-1ghuf283a-OtP4mCPJREd~367VX~TaQQ) for real time support! diff --git a/requirements.txt b/requirements.txt index fc2e954c..24cb83d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ dill==0.3.4 matplotlib>=3.3.2 nbsphinx -numpy>=1.19.2 +numpy>=1.19.2,<2 opt_einsum pathos>=0.2.7 diff --git a/torchquantum/measurement/measurements.py b/torchquantum/measurement/measurements.py index 41331a55..14b11b5d 100644 --- a/torchquantum/measurement/measurements.py +++ b/torchquantum/measurement/measurements.py @@ -421,7 +421,7 @@ def __init__(self, obs_list, v_c_reg_mapping=None): ) def forward(self, qdev: tq.QuantumDevice): - res_all = self.measure_multiple_times(qdev) + res_all = self.measure_multiple_times(qdev).prod(-1) return res_all.sum(-1) @@ -449,8 +449,9 @@ def __init__(self, obs_list, v_c_reg_mapping=None): ) def forward(self, qdev: tq.QuantumDevice): - res_all = self.measure_multiple_times(qdev) - return (res_all * self.obs_list[0]["coefficient"]).sum(-1) + res_all = self.measure_multiple_times(qdev).prod(-1) + + return (res_all * torch.tensor(self.obs_list[0]["coefficient"])).sum(-1) if __name__ == '__main__':