MCPcopy Create free account
hub / github.com/numpy/numpy / H

Method H

numpy/matrixlib/defmatrix.py:970–1002  ·  view source on GitHub ↗

Returns the (complex) conjugate transpose of `self`. Equivalent to ``np.transpose(self)`` if `self` is real-valued. Parameters ---------- None Returns ------- ret : matrix object complex conjugate transpose of `self`

(self)

Source from the content-addressed store, hash-verified

968
969 @property
970 def H(self):
971 """
972 Returns the (complex) conjugate transpose of `self`.
973
974 Equivalent to ``np.transpose(self)`` if `self` is real-valued.
975
976 Parameters
977 ----------
978 None
979
980 Returns
981 -------
982 ret : matrix object
983 complex conjugate transpose of `self`
984
985 Examples
986 --------
987 >>> x = np.matrix(np.arange(12).reshape((3,4)))
988 >>> z = x - 1j*x; z
989 matrix([[ 0. +0.j, 1. -1.j, 2. -2.j, 3. -3.j],
990 [ 4. -4.j, 5. -5.j, 6. -6.j, 7. -7.j],
991 [ 8. -8.j, 9. -9.j, 10.-10.j, 11.-11.j]])
992 >>> z.getH()
993 matrix([[ 0. -0.j, 4. +4.j, 8. +8.j],
994 [ 1. +1.j, 5. +5.j, 9. +9.j],
995 [ 2. +2.j, 6. +6.j, 10.+10.j],
996 [ 3. +3.j, 7. +7.j, 11.+11.j]])
997
998 """
999 if issubclass(self.dtype.type, N.complexfloating):
1000 return self.transpose().conjugate()
1001 else:
1002 return self.transpose()
1003
1004 # kept for compatibility
1005 getT = T.fget

Callers

nothing calls this directly

Calls 1

conjugateMethod · 0.80

Tested by

no test coverage detected