我正在尝试执行这个简单的操作
tensor(hadamard_transform(1), hadamard_transform(1), identity(2), identity(2)) * basis(16,1)
但我得到了
Traceback (most recent call last):
File "<ipython-input-163-ae66af2f799c>", line 1, in <module>
tensor(hadamard_transform(1), hadamard_transform(1), identity(2), identity(2)) * basis(16,1)
File "/home/abdallaessam/anaconda2/envs/Quantum/lib/python2.7/site-packages/qutip/qobj.py", line 515, in __mul__
raise TypeError("Incompatible Qobj shapes")
TypeError: Incompatible Qobj shapes
我在 Ubuntu 14.04LTS x64 中使用 Anaconda。
~$ conda info
active environment : Quantum
active env location : /home/user/anaconda2/envs/Quantum
shell level : 1
user config file : /home/user/.condarc
populated config files : /home/user/.condarc
conda version : 4.5.4
conda-build version : 3.10.5
python version : 2.7.15.final.0
base environment : /home/user/anaconda2 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/linux-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/linux-64
https://repo.anaconda.com/pkgs/pro/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /home/user/anaconda2/pkgs
/home/user/.conda/pkgs
envs directories : /home/user/anaconda2/envs
/home/user/.conda/envs
platform : linux-64
user-agent : conda/4.5.4 requests/2.18.4 CPython/2.7.15 Linux/3.13.0-141-generic ubuntu/14.04 glibc/2.19
UID:GID : 1000:1000
netrc file : None
offline mode : False
>>> from qutip import *
>>> about()
QuTiP: Quantum Toolbox in Python
Copyright (c) 2011 and later.
A. J. Pitchford, P. D. Nation, R. J. Johansson, A. Grimsmo, and C. Granade
QuTiP Version: 4.2.0
Numpy Version: 1.13.3
Scipy Version: 1.1.0
Cython Version: 0.28.3
Matplotlib Version: 2.2.2
Python Version: 2.7.15
Number of CPUs: 2
BLAS Info: INTEL MKL
OPENMP Installed: False
INTEL MKL Ext: True
Platform Info: Linux (x86_64)
Installation path: /home/user/anaconda2/envs/Quantum/lib/python2.7/site-packages/qutip
如何解决这个问题?