DQN Pytorch not working

Hello I am new here
my name is Chris I study CS.
I am implementing the DQN algorithm in Pytorch
and I made an simple example.
It has 2 States and 4 actions.

For state 1 the action 1 gets a reward of plus 5 and state 2 the action 3 gets -5
after training for a wile the q function for bothstate are almost equal.

I think for the state 1 the q value for action1 should be close to 5

and for state 2 the q value action 3 should be close to -5

Does anyone now what could I do wrong

Thank you for your help

Not only the rewards but also the transition probabilities determine your q-values. So please check your transition probabilities.

If you only have 2 states and 4 actions you can also compute your q-function numerically with e.g. value iteration. You can then compare the numerically computed results with the ones of your Pytorch model.