0
$\begingroup$

Suppose I have the states \Psi, \Phi and \Zeta and I also have the following relations given by the operators A and B when acting in the states

A.\Psi=1*\Psi;
B.\Psi=2*\Psi;
A.\Phi=3*\Phi;
B.\Phi=4*\Phi;
A.\Zeta=3*\Zeta;
B.\Zeta=4*\Zeta;

where I am denoting by a dot the action of A and B. If I define

list1={A,B};
list2={10*\Psi,5\Phi + \Zeta};

And, from them, I multiply the two lists

list3=Table[Table[i.j,{i,list1}],{j,list2}]
    

giving

list3={{A.10*\Psi,B.10*\Psi},{A.(5\Phi + \Zeta),B.(5\Phi + \Zeta)}}
     ={{1*(10*\Psi),2*(10*\Psi)},{3*(5\Phi + \Zeta),4*(5\Phi + \Zeta)}}

where the second line comes after using the relations given in the first lines of code.

How do I make Mathematica write only the eigenvalues of the operators A and B when acting on list2 (I want it to write {{1,2},{3,4}} from list3)?

$\endgroup$
7
  • 2
    $\begingroup$ Can you please explain why 5\Phi + \Phi is not equal to 6\Phi? Also, I'm having troubles understanding the task ... Are you looking for something like: a[psi] = 1; b[psi] = 2; a[phi] = 3; b[phi] = 4; Table[f[First@Variables@j], {f, {a, b}}, {j, {10 psi, 6 phi}}]? $\endgroup$
    – Domen
    Commented Dec 26, 2021 at 23:18
  • $\begingroup$ @Domen Sorry, It was a mistake and now I edited. $\endgroup$
    – Slayer147
    Commented Dec 27, 2021 at 0:31
  • $\begingroup$ are you sure in advance that all the states in list2 are eigenstates? What should be the result of the code if it is not an eigenstate, for example, A[Ψ + Φ]? $\endgroup$
    – Domen
    Commented Dec 27, 2021 at 0:48
  • $\begingroup$ @Domen Yes, all states in list2 are eigenstates of the operators in list1 in my case $\endgroup$
    – Slayer147
    Commented Dec 27, 2021 at 0:52
  • 1
    $\begingroup$ In that case, the code from my comment above should work. Have you tried it? Given your definitions of the operators, the prefactors you are looking for can be simply determined by the combination of the operator and the state. $\endgroup$
    – Domen
    Commented Dec 27, 2021 at 0:57

1 Answer 1

0
$\begingroup$

As @Domen wrote in the comments, the question can be answered by the following code

A[\[Psi]] = 1;
B[\[Psi]] = 2;
A[\[Phi]] = 3;
B[\[Phi]] = 4;
A[\[Zeta]] = 3;
B[\[Zeta]] = 4;

list1 = {A, B};
list2 = {10*\[Psi], 5 \[Phi] + \[Zeta]};

list3 = Table[Table[i[First@Variables[j]], {i, list1}], {j, list2}]

which gives as the output the desired answer

{{1, 2}, {3, 4}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.