Unit Tests

The Quantum Algebra supplement is accompanied by a series of unit tests. They are intended to ensure that changes to the code remain executable.

At the same time, it helps to track which rules lead to which simplifications.

(* Combine product of Integrations *)
Test[
    QAIntegrate[Subscript[x, 1], V, 3, x] QAIntegrate[Subscript[y, 2], V, 3, y],
    QAIntegrate[Subscript[x, 1] Subscript[y, 2], V, 3, x, y],
    TestID->"Integrate-20181213-P3R4W5"
]

(* Apply DiracDelta in Integrate about 2 integration ranges *)
Test[
    QAIntegrate[
        Subscript[x, 1] Subscript[y, 2] * 
        DiracDelta[Subscript[x, 1] - Subscript[y, 1], Subscript[x, 2] - Subscript[y, 2], Subscript[x, 3] - Subscript[y, 3]], 
        V, 3, x, y],
    QAIntegrate[Subscript[x, 1] Subscript[x, 2], V, 3, x],
    TestID->"Integrate-20181213-N8K6H2"
]

(* Integrate about Exponential resolved to DiracDelta *)
Test[
    QAIntegrate[
        Power[E, I (Subscript[k, 1] (Subscript[x, 1] - Subscript[y, 1]) + Subscript[k, 2] (Subscript[x, 2] - Subscript[y, 2]))], 
        Infinity, 2, k],
    DiracDelta[Subscript[x, 1] - Subscript[y, 1], Subscript[x, 2] - Subscript[y, 2]] 4 Pi^2,
    TestID->"Integrate-20181216-P1R1T9"
]

(* Test of Name Ordering Rule, op1 ** op2 are in reverse order *)
Test[
    (op1 = Operator[q, "H", { Subscript[k, 1], Subscript[k, 2] }, {}];
    op2 = Operator[p, "H", { Subscript[l, 1], Subscript[l, 2] }, {}];
    (op1 ** op2) /. { DefineNameOrderingRule[False, 2] }),
    op2 ** op1,
    TestID->"NameOrdering-20181226-X4S4F9"
]

(* Derivation of an Operator Product *)
Test[
    QAD[Operator[a, { Subscript[x, 1] }, {}] ** Operator[b, { Subscript[x, 1] }, { s }], Subscript[x, 1]],

    QAD[Operator[a, { Subscript[x, 1] }, {}], Subscript[x, 1]] ** Operator[b, { Subscript[x, 1] }, { s }] + 
        Operator[a, { Subscript[x, 1] }, {}] ** QAD[Operator[b, { Subscript[x, 1] }, { s }], Subscript[x, 1]],

    TestID->"Derivation-20181217-L0J8L0"
]

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

Ok