📜  Python| numpy matrix.conjugate()

📅  最后修改于: 2022-05-13 01:54:36.590000             🧑  作者: Mango

Python| numpy matrix.conjugate()

借助Numpy matrix.conjugate()方法,我们能够找到具有一维或多维的给定矩阵的共轭

示例 #1:
在此示例中,我们可以看到matrix.conjugate()方法用于对矩阵进行共轭。记住字符串类型的矩阵在这里不起作用。

# import the important module in python
import numpy as np
           
# make an array with numpy
gfg = np.matrix('[1 + 2j, 2 + 3j]')
           
# applying matrix.conjugate() method
geeks = gfg.conjugate()
     
print(geeks)
输出:
[[ 1.-2.j  2.-3.j]]

示例 #2:

# import the important module in python
import numpy as np
           
# make an array with numpy
gfg = np.matrix('[1 + 2j, 2 + 3j, 3-2j; 1-4j, 2-3j, 7 + 8j]')
           
# applying matrix.conjugate() method
geeks = gfg.conjugate()
     
print(geeks)
输出:
[[ 1.-2.j  2.-3.j  3.+2.j]
 [ 1.+4.j  2.+3.j  7.-8.j]]