Here's the Python code I'm working on:
def inver_hopf(x,y,z):
return (1/np.sqrt(x**2+y**2+(1+z)**2))*np.matrix([[1+z],[x+y.j]],dtype=complex)
The problem happens at [x+y.j]
, where j
means complex unit. It returns me the error message AttributeError: 'int' object has no attribute 'j'
. If I remove the dot, then it returns NameError: name 'yj' is not defined
. How can I correct that? Thanks!
j
alone is a variable, you can have the complex number by typing 1j
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With