crazy4pi314 / learn-qc-with-python-and-qsharp

Companion code for Learn Quantum Computing with Python and Q# Book by Dr. Sarah Kaiser and Dr. Cassandra Granade 💖
https://bit.ly/qsharp-book
MIT License
90 stars 51 forks source link

Ch02 and Ch03 measurement function #26

Open MBounouar opened 2 years ago

MBounouar commented 2 years ago

https://github.com/crazy4pi314/learn-qc-with-python-and-qsharp/blob/7ffb0119e4f223ff9ab6e2dad0fa381923d2538e/ch02/simulator.py#L32

In Chapter 2 and 3, wouldn't it be didactically more correct to write the measurement function as a product ?

np.abs((KET_0.T @ self.state) ** 2)[0, 0] ?