Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.09 KB

conj.md

File metadata and controls

65 lines (43 loc) · 1.09 KB

conj

Compute the complex conjugate by negating each imaginary component.

API

Numeric.complex.conj(value)

Negates the imaginary part of each entry.

  • Parameters:
    • value: Complex or real values to conjugate
  • Returns: Conjugated values matching the input nesting shape
  • NumPy: Covers np.conj, np.conjugate, ndarray.conj, ndarray.conjugate through a single Numerix method.

Examples

Conjugate of a real value

import Numeric from '@neabyte/numerix'

const value = Numeric.complex.conj(5)

console.log(value)
// 5

Conjugate of a complex value

import Numeric from '@neabyte/numerix'

const value = Numeric.complex.conj({ re: 3, im: 4 })

console.log(value)
// {"re":3,"im":-4}

Conjugates of a vector

import Numeric from '@neabyte/numerix'

const values = Numeric.complex.conj([1, 2])

console.log(values)
// [1,2]

Conjugates of complex values

import Numeric from '@neabyte/numerix'

const values = Numeric.complex.conj([
  { re: 1, im: 2 },
  { re: 3, im: -4 }
])

console.log(values)
// [{"re":1,"im":-2},{"re":3,"im":4}]