1 package JSci.physics.quantum; 2 3 import JSci.maths.AbstractMath; 4 import JSci.maths.Complex; 5 6 12 public final class QuantumMath extends AbstractMath { 13 private QuantumMath() {} 14 15 17 22 public static Operator commutator(final Operator A, final Operator B) { 23 return (A.multiply(B)).subtract(B.multiply(A)); 24 } 25 26 28 33 public static Operator anticommutator(final Operator A, final Operator B) { 34 return (A.multiply(B)).add(B.multiply(A)); 35 } 36 37 39 45 public static Complex expectation(final Operator op, final KetVector ket) { 46 return ket.toBraVector().multiply(op).multiply(ket); 47 } 48 54 public static Complex expectation(final DensityMatrix dm, final Operator op) { 55 return dm.multiply(op).trace(); 56 } 57 58 60 66 public static Complex probability(final Projector p, final KetVector ket) { 67 return ket.toBraVector().multiply(p).multiply(ket); 68 } 69 75 public static Complex probability(final DensityMatrix dm, final Projector p) { 76 return dm.multiply(p).trace(); 77 } 78 } 79 80 | Popular Tags |