Conjugates.jl

Goofy physics notation
Author MasonProtter
Popularity
11 Stars
Updated Last
3 Years Ago
Started In
April 2020

Conjugates.jl

Conjugates is available on the general registry. To install, simply do

pkg> add Conjugates

Conjugates.jl is a simple little utility for doing algebraic operations between an object and its ‘conjugate’, either Hermitian conjugate or transpose. Conjugates.jl exports hc, standing for Hermitian conjugate and tp, standing for transpose which act like algebraic objects

julia> using Conjugates

julia> (1 + im) + hc
2

julia> randn(ComplexF64, 3, 3) + hc
3×3 Hermitian{Complex{Float64},Array{Complex{Float64},2}}:
   0.86551+0.0im         1.38105+0.506667im  -0.761315-0.211322im
   1.38105-0.506667im   0.826828+0.0im       -0.764402-0.579842im
 -0.761315+0.211322im  -0.764402+0.579842im  -0.629772+0.0im

julia> randn(ComplexF64, 3, 3) - hc
3×3 Array{Complex{Float64},2}:
       0.0-2.32902im     1.0509+0.968614im   0.899756+1.20646im
   -1.0509+0.968614im       0.0+0.235916im  -0.554544+0.872074im
 -0.899756+1.20646im   0.554544+0.872074im        0.0+1.15158im

julia> randn(ComplexF64, 3, 3) * tp
3×3 Symmetric{Complex{Float64},Array{Complex{Float64},2}}:
   2.43339+0.0im        -1.48393-0.247791im  0.0867097+0.53651im
  -1.48393-0.247791im    1.38745+0.0im       0.0606936-0.470711im
 0.0867097+0.53651im   0.0606936-0.470711im    2.14239+0.0im

assets/meme.png