HaeffnerLab / IonSim.jl

a simple tool for simulating trapped ion systems
https://ionsim.org
MIT License
71 stars 17 forks source link

IonSim should give better error messages when vibrational modes are given in a different order #21

Open kdbarajas opened 2 years ago

kdbarajas commented 2 years ago

Example: # Define the initial density matrix ρ_axial = thermalstate(axial_mode,6) ρ_radial = thermalstate(radial_mode,6) ρ_ions = dm(Ca["D-1/2"] ⊗ Ca["S-1/2"]) ρ_initial = ρ_ions ⊗ ρ_axial ⊗ ρ_radial returns IonSim: Incompatible basis without further information

Temporary solution is to reorder the vibrational modes density matrix: ρ_initial = ρ_ions ⊗ ρ_radial ⊗ ρ_axial # Corrects Incompatible basis

IonSim should be able to check for this issue and properly correct for it if the ordering doesn't matter

marwahaha commented 2 years ago

I disagree that IonSim should automatically correct for this. We could improve the error message, like Incompatible basis. Make sure the format is (ion, radial, axial).