Skip to content

Commit

Permalink
Implements multiplication by imaginary scalr in complex_fcn
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfreddy committed Aug 23, 2023
1 parent 8186a48 commit c0cf264
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orbital4c/complex_fcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ def real_mul(self, coeff):
output.imag = self.imag * coeff
return output

def imag_mul(self, coeff):
output = complex_fcn()
output.real = self.imag * (-1.0 * coeff)
output.imag = self.real * coeff
return output

def __rmul__(self, other):
output = complex_fcn()
output.real = self.real * np.real(other) - self.imag * np.imag(other)
Expand Down

0 comments on commit c0cf264

Please sign in to comment.