------------------------------Epoch1------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0235+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0118j],
        [0.0000+0.0118j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8118-0.3343j, 0.4390+0.1910j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7708, 0.2292]], grad_fn=<PowBackward0>)
loss:  1.4729598760604858
loss:  0.4806354343891144
loss:  0.569081723690033
loss:  0.44523751735687256
----------index4----------
train inputs:  tensor([[1.0685, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0246+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0123j],
        [0.0000+0.0123j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6791-0.5188j, 0.4104+0.3183j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7303, 0.2697]], grad_fn=<PowBackward0>)
loss:  0.3143676817417145
loss:  0.7896216511726379
loss:  0.706161618232727
loss:  0.34294670820236206
----------index8----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0255+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0128j],
        [0.0000+0.0128j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6989-0.4094j, 0.5022+0.3029j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6561, 0.3439]], grad_fn=<PowBackward0>)
loss:  1.0673149824142456
loss:  0.7058997750282288
loss:  1.3221540451049805
loss:  0.3353603184223175
----------index12----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0270+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0135j],
        [0.0000+0.0135j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2485-0.2030j, 0.7286+0.6052j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1029, 0.8971]], grad_fn=<PowBackward0>)
loss:  0.10861022770404816
loss:  0.7062983512878418
loss:  0.7890831232070923
loss:  0.6344917416572571
----------index16----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5443-0.4141j, 0.5774+0.4460j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4677, 0.5323]], grad_fn=<PowBackward0>)
loss:  0.6305636167526245
loss:  0.14890938997268677
loss:  0.3707669973373413
loss:  0.12853017449378967
----------index20----------
train inputs:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0300+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0150j],
        [0.0000+0.0150j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5531-0.6197j, 0.3722+0.4141j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6900, 0.3100]], grad_fn=<PowBackward0>)
loss:  0.3710471987724304
loss:  0.04355234280228615
loss:  0.1918574869632721
loss:  0.1732528954744339
----------index24----------
train inputs:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0306+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0153j],
        [0.0000+0.0153j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5760-0.3684j, 0.6098+0.4008j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4675, 0.5325]], grad_fn=<PowBackward0>)
loss:  0.6302136182785034
loss:  0.4275772273540497
loss:  0.31868934631347656
loss:  0.4275636076927185
----------index28----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0309+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0155j],
        [0.0000+0.0155j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6953-0.5309j, 0.3823+0.2977j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7652, 0.2348]], grad_fn=<PowBackward0>)
loss:  0.26758134365081787
loss:  0.3858369290828705
loss:  0.0438380241394043
loss:  0.2678375542163849
----------index32----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9230+0.j, 0.3849+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9230+0.j, 0.3849+0.j]])
New state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0308+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0154j],
        [0.0000+0.0154j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6839-0.6108j, 0.2963+0.2672j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8408, 0.1592]], grad_fn=<PowBackward0>)
loss:  0.17339913547039032
loss:  1.3494877815246582
loss:  0.31846582889556885
loss:  0.8628379702568054
----------index36----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0306+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0153j],
        [0.0000+0.0153j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5822-0.1539j, 0.7660+0.2249j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3627, 0.6373]], grad_fn=<PowBackward0>)
loss:  0.4505128860473633
loss:  0.5653395056724548
loss:  0.8413689732551575
loss:  0.2822997272014618
----------index40----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0307+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0153j],
        [0.0000+0.0153j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4504-0.3414j, 0.6532+0.5039j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3194, 0.6806]], grad_fn=<PowBackward0>)
loss:  0.384848415851593
loss:  0.3852894902229309
loss:  0.5492274165153503
loss:  0.49887698888778687
----------index44----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0310+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0155j],
        [0.0000+0.0155j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4107-0.6403j, 0.3574+0.5419j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5786, 0.4214]], grad_fn=<PowBackward0>)
loss:  0.5470716953277588
loss:  0.5470927357673645
loss:  0.12894311547279358
loss:  0.21982920169830322
----------index48----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0309+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0154j],
        [0.0000+0.0154j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6215-0.6453j, 0.3086+0.3195j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8027, 0.1973]], grad_fn=<PowBackward0>)
loss:  0.21978820860385895
loss:  0.3709915578365326
loss:  0.00023415446048602462
loss:  0.318433552980423
----------index52----------
train inputs:  tensor([[0.6797, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0303+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7225-0.5978j, 0.2657+0.2237j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8794, 0.1206]], grad_fn=<PowBackward0>)
loss:  0.12857003509998322
loss:  0.614979088306427
loss:  0.14883501827716827
loss:  0.5647880434989929
----------index56----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0296+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0148j],
        [0.0000+0.0148j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2477-0.2020j, 0.7288+0.6055j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1021, 0.8979]], grad_fn=<PowBackward0>)
loss:  0.10772998631000519
loss:  0.23667855560779572
loss:  0.08242830634117126
loss:  0.00021769985323771834
----------index60----------
train inputs:  tensor([[1.2310, 2.1598]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.1598+0.j]])
rz_matrix:  tensor([[0.4714-0.8819j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.4714+0.8819j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0295+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0147j],
        [0.0000+0.0147j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3774-0.7160j, 0.2827+0.5148j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6550, 0.3450]], grad_fn=<PowBackward0>)
loss:  0.42305293679237366
loss:  0.26703038811683655
loss:  1.1816519498825073
loss:  0.36959409713745117
----------index64----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0292+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0146j],
        [0.0000+0.0146j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4758-0.1579j, 0.8138+0.2939j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2513, 0.7487]], grad_fn=<PowBackward0>)
loss:  0.28943654894828796
loss:  0.31755733489990234
loss:  0.3695012629032135
loss:  0.4407114088535309
----------index68----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.1925+0.j, 0.9813+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0290+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0145j],
        [0.0000+0.0145j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1391-0.1119j, 0.7571+0.6284j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0319, 0.9681]], grad_fn=<PowBackward0>)
loss:  0.03237185627222061
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.44524329900741577
------------------------------Epoch2------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.9106, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0290+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0145j],
        [0.0000+0.0145j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4645-0.3236j, 0.6714+0.4782j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3205, 0.6795]], grad_fn=<PowBackward0>)
loss:  0.38644957542419434
loss:  0.42626214027404785
loss:  0.42612531781196594
loss:  0.5004561543464661
----------index4----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0289+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0144j],
        [0.0000+0.0144j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4509-0.3420j, 0.6529+0.5035j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3203, 0.6797]], grad_fn=<PowBackward0>)
loss:  0.3860533833503723
loss:  0.31737369298934937
loss:  0.04329543933272362
loss:  0.3174453377723694
----------index8----------
train inputs:  tensor([[1.4595, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0288+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0144j],
        [0.0000+0.0144j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4897-0.5491j, 0.4524+0.5040j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5413, 0.4587]], grad_fn=<PowBackward0>)
loss:  0.6137451529502869
loss:  0.565613865852356
loss:  0.2665959298610687
loss:  0.2665451467037201
----------index12----------
train inputs:  tensor([[0.6797, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0284+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6507-0.6755j, 0.2409+0.2493j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8798, 0.1202]], grad_fn=<PowBackward0>)
loss:  0.12803693115711212
loss:  0.334384560585022
loss:  0.3699396848678589
loss:  0.34202855825424194
----------index16----------
train inputs:  tensor([[0.6797, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0279+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0140j],
        [0.0000+0.0140j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7227-0.5981j, 0.2650+0.2229j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8801, 0.1199]], grad_fn=<PowBackward0>)
loss:  0.12771187722682953
loss:  0.3686896562576294
loss:  0.03260010853409767
loss:  0.7892104983329773
----------index20----------
train inputs:  tensor([[1.8331, 1.6078]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0275+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0138j],
        [0.0000+0.0138j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4144-0.4306j, 0.5566+0.5771j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3571, 0.6429]], grad_fn=<PowBackward0>)
loss:  0.4418146014213562
loss:  0.10842042416334152
loss:  0.00019039535254705697
loss:  0.2181912064552307
----------index24----------
train inputs:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0276+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0138j],
        [0.0000+0.0138j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5536-0.6202j, 0.3715+0.4134j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6911, 0.3089]], grad_fn=<PowBackward0>)
loss:  0.3694799840450287
loss:  1.0648382902145386
loss:  0.44293904304504395
loss:  0.5444992184638977
----------index28----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0277+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0139j],
        [0.0000+0.0139j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6958-0.5315j, 0.3815+0.2966j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7665, 0.2335]], grad_fn=<PowBackward0>)
loss:  0.26586243510246277
loss:  0.31617963314056396
loss:  0.632769763469696
loss:  0.8661734461784363
----------index32----------
train inputs:  tensor([[2.2519, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.2519]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.2519+0.j]])
ry_matrix:  tensor([[ 0.4303-0.j, -0.9027-0.j],
        [ 0.9027+0.j,  0.4303-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4303+0.j, 0.9027+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.4303+0.j, 0.9027+0.j]])
New state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0277+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0139j],
        [0.0000+0.0139j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3541-0.2237j, 0.7604+0.4963j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1755, 0.8245]], grad_fn=<PowBackward0>)
loss:  0.19294188916683197
loss:  0.14935053884983063
loss:  0.6310954093933105
loss:  0.23736579716205597
----------index36----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0284+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5276-0.5480j, 0.4507+0.4671j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5786, 0.4214]], grad_fn=<PowBackward0>)
loss:  0.5470873713493347
loss:  0.2897028923034668
loss:  0.3872615098953247
loss:  0.7050390839576721
----------index40----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0290+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0145j],
        [0.0000+0.0145j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5042-0.6608j, 0.3409+0.4393j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6908, 0.3092]], grad_fn=<PowBackward0>)
loss:  0.3698544502258301
loss:  1.1818290948867798
loss:  0.8400537967681885
loss:  1.3187096118927002
----------index44----------
train inputs:  tensor([[2.3514, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.3514]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.3514+0.j]])
ry_matrix:  tensor([[ 0.3849-0.j, -0.9230-0.j],
        [ 0.9230+0.j,  0.3849-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3849+0.j, 0.9230+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.3849+0.j, 0.9230+0.j]])
New state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0297+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0148j],
        [0.0000+0.0148j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3063-0.2110j, 0.7568+0.5375j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1384, 0.8616]], grad_fn=<PowBackward0>)
loss:  0.1489318609237671
loss:  0.5658789873123169
loss:  1.3495069742202759
loss:  0.6328283548355103
----------index48----------
train inputs:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0305+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0153j],
        [0.0000+0.0153j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5679-0.6362j, 0.3492+0.3882j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7273, 0.2727]], grad_fn=<PowBackward0>)
loss:  0.3183633089065552
loss:  0.10738065838813782
loss:  0.7003985047340393
loss:  0.42404425144195557
----------index52----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0313+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5822-0.1537j, 0.7660+0.2251j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3625, 0.6375]], grad_fn=<PowBackward0>)
loss:  0.4502401053905487
loss:  0.2818422317504883
loss:  0.08283492922782898
loss:  0.12924884259700775
----------index56----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0319+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0160j],
        [0.0000+0.0160j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5815-0.4066j, 0.5731+0.4100j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5035, 0.4965]], grad_fn=<PowBackward0>)
loss:  0.7000964879989624
loss:  0.17396067082881927
loss:  0.5628678202629089
loss:  1.4612482786178589
----------index60----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0327+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0163j],
        [0.0000+0.0163j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0099+0.0130j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9973e-01, 2.6701e-04]], grad_fn=<PowBackward0>)
loss:  0.0002670644607860595
loss:  0.4874108135700226
loss:  0.1743624359369278
loss:  0.372047483921051
----------index64----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0332+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6680-0.3107j, 0.6070+0.2980j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5427, 0.4573]], grad_fn=<PowBackward0>)
loss:  0.7824406623840332
loss:  0.5488705635070801
loss:  0.2210172414779663
loss:  0.044340651482343674
----------index68----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0333+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5910-0.6138j, 0.3636+0.3765j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7260, 0.2740]], grad_fn=<PowBackward0>)
loss:  0.3201734721660614
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.4455259144306183
------------------------------Epoch3------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.3845, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0332+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6043-0.4600j, 0.5142+0.3985j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5768, 0.4232]], grad_fn=<PowBackward0>)
loss:  0.8598331809043884
loss:  0.4375585913658142
loss:  0.2879619300365448
loss:  0.22106899321079254
----------index4----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0335+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5264-0.5468j, 0.4521+0.4685j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5761, 0.4239]], grad_fn=<PowBackward0>)
loss:  0.5514710545539856
loss:  0.12992408871650696
loss:  0.49692127108573914
loss:  0.34025731682777405
----------index8----------
train inputs:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0335+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5642-0.4289j, 0.5579+0.4318j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5024, 0.4976]], grad_fn=<PowBackward0>)
loss:  0.6978647708892822
loss:  0.425549179315567
loss:  0.03155060112476349
loss:  0.1474163830280304
----------index12----------
train inputs:  tensor([[1.2310, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0338+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5595-0.5811j, 0.4105+0.4252j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6507, 0.3493]], grad_fn=<PowBackward0>)
loss:  0.4297587275505066
loss:  0.269426554441452
loss:  1.176393747329712
loss:  0.3827688992023468
----------index16----------
train inputs:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0170j],
        [0.0000+0.0170j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4767-0.3026j, 0.6902+0.4526j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3188, 0.6812]], grad_fn=<PowBackward0>)
loss:  0.38393455743789673
loss:  0.4384082555770874
loss:  0.6979200839996338
loss:  0.08337990939617157
----------index20----------
train inputs:  tensor([[1.3085, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3085+0.j]])
ry_matrix:  tensor([[ 0.7935-0.j, -0.6086-0.j],
        [ 0.6086+0.j,  0.7935-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935+0.j, 0.6086+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.7935+0.j, 0.6086+0.j]])
New state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0346+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4745-0.6231j, 0.3812+0.4912j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6134, 0.3866]], grad_fn=<PowBackward0>)
loss:  0.4887443780899048
loss:  0.13033652305603027
loss:  0.5609093904495239
loss:  0.7834720015525818
----------index24----------
train inputs:  tensor([[0.3873, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0351+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0176j],
        [0.0000+0.0176j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7765-0.5944j, 0.1632+0.1308j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9563, 0.0437]], grad_fn=<PowBackward0>)
loss:  0.044711820781230927
loss:  1.457550287246704
loss:  0.6287884712219238
loss:  1.0550085306167603
----------index28----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0360+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0180j],
        [0.0000+0.0180j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6207-0.6445j, 0.3103+0.3211j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8006, 0.1994]], grad_fn=<PowBackward0>)
loss:  0.22234894335269928
loss:  0.37401068210601807
loss:  0.3213456869125366
loss:  0.10546372830867767
----------index32----------
train inputs:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0366+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0183j],
        [0.0000+0.0183j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4761-0.6791j, 0.3268+0.4532j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6878, 0.3122]], grad_fn=<PowBackward0>)
loss:  0.3742668032646179
loss:  0.6980224847793579
loss:  0.18914654850959778
loss:  1.3492923974990845
----------index36----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0371+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0185j],
        [0.0000+0.0185j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5969-0.5747j, 0.4027+0.3888j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6866, 0.3134]], grad_fn=<PowBackward0>)
loss:  0.37594684958457947
loss:  0.37585586309432983
loss:  0.32910820841789246
loss:  0.32258710265159607
----------index40----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0372+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0186j],
        [0.0000+0.0186j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8081-0.2779j, 0.4853+0.1848j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7303, 0.2697]], grad_fn=<PowBackward0>)
loss:  1.3105180263519287
loss:  0.27135831117630005
loss:  0.4478772282600403
loss:  0.14567901194095612
----------index44----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0375+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0187j],
        [0.0000+0.0187j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5423-0.4115j, 0.5792+0.4485j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4634, 0.5366]], grad_fn=<PowBackward0>)
loss:  0.622526228427887
loss:  0.6242496967315674
loss:  0.1313122659921646
loss:  0.43265408277511597
----------index48----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0380+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0190j],
        [0.0000+0.0190j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5022-0.6592j, 0.3439+0.4415j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6868, 0.3132]], grad_fn=<PowBackward0>)
loss:  0.3757038116455078
loss:  0.00036120976437814534
loss:  0.1765265166759491
loss:  0.1765187680721283
----------index52----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0380+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0190j],
        [0.0000+0.0190j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4088-0.6391j, 0.3596+0.5433j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5755, 0.4245]], grad_fn=<PowBackward0>)
loss:  0.5525216460227966
loss:  0.3228493332862854
loss:  0.3228946924209595
loss:  0.5522153973579407
----------index56----------
train inputs:  tensor([[2.1598, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.1598+0.j]])
ry_matrix:  tensor([[ 0.4714-0.j, -0.8819-0.j],
        [ 0.8819+0.j,  0.4714-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4714+0.j, 0.8819+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.4714+0.j, 0.8819+0.j]])
New state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0374+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0187j],
        [0.0000+0.0187j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3753-0.2587j, 0.7250+0.5163j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2078, 0.7922]], grad_fn=<PowBackward0>)
loss:  0.2329065203666687
loss:  0.5590988397598267
loss:  0.0003449319628998637
loss:  0.27864816784858704
----------index60----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0370+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0185j],
        [0.0000+0.0185j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2454-0.1993j, 0.7296+0.6064j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0999, 0.9001]], grad_fn=<PowBackward0>)
loss:  0.10529325902462006
loss:  0.3223496973514557
loss:  0.7792186737060547
loss:  0.8477886915206909
----------index64----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0370+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0185j],
        [0.0000+0.0185j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7990-0.5636j, 0.1676+0.1259j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9561, 0.0439]], grad_fn=<PowBackward0>)
loss:  0.044929441064596176
loss:  0.6212098002433777
loss:  0.3814043700695038
loss:  0.2706982493400574
----------index68----------
train inputs:  tensor([[1.6821, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0366+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0183j],
        [0.0000+0.0183j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5814-0.3022j, 0.6630+0.3621j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4293, 0.5707]], grad_fn=<PowBackward0>)
loss:  0.5609785318374634
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.44575539231300354
------------------------------Epoch4------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[0.5513, 0.6797]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.5513+0.j]])
ry_matrix:  tensor([[ 0.9623-0.j, -0.2722-0.j],
        [ 0.2722+0.j,  0.9623-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9623+0.j, 0.2722+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.9623+0.j, 0.2722+0.j]])
New state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0366+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0183j],
        [0.0000+0.0183j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9054-0.3160j, 0.2624+0.1073j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9196, 0.0804]], grad_fn=<PowBackward0>)
loss:  0.08379729092121124
loss:  0.6957289576530457
loss:  0.32206398248672485
loss:  0.3755844831466675
----------index4----------
train inputs:  tensor([[1.1512, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0365+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0182j],
        [0.0000+0.0182j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7528-0.3520j, 0.4979+0.2480j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6906, 0.3094]], grad_fn=<PowBackward0>)
loss:  1.173193097114563
loss:  0.7822563052177429
loss:  0.3221941292285919
loss:  0.10543312877416611
----------index8----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0367+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0183j],
        [0.0000+0.0183j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8105-0.3314j, 0.4412+0.1963j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7668, 0.2332]], grad_fn=<PowBackward0>)
loss:  1.45570707321167
loss:  0.6231474876403809
loss:  0.32166942954063416
loss:  0.7791603803634644
----------index12----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0372+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0186j],
        [0.0000+0.0186j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4090-0.6392j, 0.3594+0.5431j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5758, 0.4242]], grad_fn=<PowBackward0>)
loss:  0.5519509315490723
loss:  1.3492802381515503
loss:  0.37601882219314575
loss:  0.6973827481269836
----------index16----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0375+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0188j],
        [0.0000+0.0188j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6984-0.6238j, 0.2602+0.2354j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8769, 0.1231]], grad_fn=<PowBackward0>)
loss:  0.13136549293994904
loss:  0.4359592795372009
loss:  0.37492096424102783
loss:  0.045081570744514465
----------index20----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0377+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0189j],
        [0.0000+0.0189j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6054-0.3151j, 0.6411+0.3509j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4658, 0.5342]], grad_fn=<PowBackward0>)
loss:  0.6270184516906738
loss:  0.6936678886413574
loss:  0.42820703983306885
loss:  0.22335515916347504
----------index24----------
train inputs:  tensor([[1.3085, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3085+0.j]])
ry_matrix:  tensor([[ 0.7935-0.j, -0.6086-0.j],
        [ 0.6086+0.j,  0.7935-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935+0.j, 0.6086+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.7935+0.j, 0.6086+0.j]])
New state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0381+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0190j],
        [0.0000+0.0190j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4736-0.6225j, 0.3823+0.4920j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6118, 0.3882]], grad_fn=<PowBackward0>)
loss:  0.4913674592971802
loss:  0.14579430222511292
loss:  0.27176231145858765
loss:  0.2713960111141205
----------index28----------
train inputs:  tensor([[1.8331, 1.6078]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0380+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0190j],
        [0.0000+0.0190j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4114-0.4277j, 0.5588+0.5793j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3522, 0.6478]], grad_fn=<PowBackward0>)
loss:  0.4340970516204834
loss:  1.0523117780685425
loss:  0.5584912896156311
loss:  0.38131752610206604
----------index32----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0383+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0191j],
        [0.0000+0.0191j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8080-0.2776j, 0.4855+0.1852j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7300, 0.2700]], grad_fn=<PowBackward0>)
loss:  1.3094136714935303
loss:  0.44743600487709045
loss:  0.3761586844921112
loss:  0.8535515069961548
----------index36----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0390+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0195j],
        [0.0000+0.0195j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4085-0.6389j, 0.3600+0.5435j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5750, 0.4250]], grad_fn=<PowBackward0>)
loss:  0.5533638000488281
loss:  0.492494136095047
loss:  0.10454925149679184
loss:  0.14488065242767334
----------index40----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0397+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0198j],
        [0.0000+0.0198j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5898-0.6126j, 0.3655+0.3784j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7232, 0.2768]], grad_fn=<PowBackward0>)
loss:  0.32409679889678955
loss:  0.13229157030582428
loss:  0.28564178943634033
loss:  0.045727260410785675
----------index44----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
New state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0401+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0200j],
        [0.0000+0.0200j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0134+0.0149j,  0.7452+0.6665j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[4.0109e-04, 9.9960e-01]], grad_fn=<PowBackward0>)
loss:  0.00040116009768098593
loss:  0.5569031238555908
loss:  0.187741219997406
loss:  0.2245253026485443
----------index48----------
train inputs:  tensor([[2.1598, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.1598+0.j]])
ry_matrix:  tensor([[ 0.4714-0.j, -0.8819-0.j],
        [ 0.8819+0.j,  0.4714-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4714+0.j, 0.8819+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.4714+0.j, 0.8819+0.j]])
New state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0404+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0202j],
        [0.0000+0.0202j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3745-0.2576j, 0.7254+0.5169j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2066, 0.7934]], grad_fn=<PowBackward0>)
loss:  0.23143033683300018
loss:  0.3271341323852539
loss:  0.13238069415092468
loss:  0.030311590060591698
----------index52----------
train inputs:  tensor([[1.0685, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0409+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0204j],
        [0.0000+0.0204j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6344-0.5659j, 0.3912+0.3525j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7227, 0.2773]], grad_fn=<PowBackward0>)
loss:  0.3247000575065613
loss:  0.3781149387359619
loss:  0.6213688850402832
loss:  0.2734629511833191
----------index56----------
train inputs:  tensor([[1.6821, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0412+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0206j],
        [0.0000+0.0206j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5806-0.3007j, 0.6637+0.3634j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4275, 0.5725]], grad_fn=<PowBackward0>)
loss:  0.5576814413070679
loss:  0.625307559967041
loss:  0.17800183594226837
loss:  0.3376711308956146
----------index60----------
train inputs:  tensor([[2.0731, 1.5338]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0414+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0207j],
        [0.0000+0.0207j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3542-0.3404j, 0.6269+0.6047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2413, 0.7587]], grad_fn=<PowBackward0>)
loss:  0.2761782109737396
loss:  0.43545013666152954
loss:  0.5583898425102234
loss:  0.8522999286651611
----------index64----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0414+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0207j],
        [0.0000+0.0207j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5353-0.6005j, 0.3974+0.4415j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6471, 0.3529]], grad_fn=<PowBackward0>)
loss:  0.4351791441440582
loss:  0.17792677879333496
loss:  0.3770815134048462
loss:  0.00041767736547626555
----------index68----------
train inputs:  tensor([[1.9106, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0407+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0203j],
        [0.0000+0.0203j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4617-0.3197j, 0.6733+0.4809j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3154, 0.6846]], grad_fn=<PowBackward0>)
loss:  0.3789013922214508
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4460383355617523
------------------------------Epoch5------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0406+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0203j],
        [0.0000+0.0203j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6966-0.4056j, 0.5052+0.3082j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6498, 0.3502]], grad_fn=<PowBackward0>)
loss:  1.0491470098495483
loss:  0.6245918273925781
loss:  0.37672215700149536
loss:  0.6947867274284363
----------index4----------
train inputs:  tensor([[0.6797, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0404+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0202j],
        [0.0000+0.0202j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6492-0.6741j, 0.2449+0.2532j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8759, 0.1241]], grad_fn=<PowBackward0>)
loss:  0.13249991834163666
loss:  0.27682703733444214
loss:  0.17751063406467438
loss:  0.44676005840301514
----------index8----------
train inputs:  tensor([[2.3514, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.3514]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.3514+0.j]])
ry_matrix:  tensor([[ 0.3849-0.j, -0.9230-0.j],
        [ 0.9230+0.j,  0.3849-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3849+0.j, 0.9230+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.3849+0.j, 0.9230+0.j]])
New state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0402+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0201j],
        [0.0000+0.0201j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3035-0.2070j, 0.7579+0.5391j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1350, 0.8650]], grad_fn=<PowBackward0>)
loss:  0.14498847723007202
loss:  0.08450998365879059
loss:  0.22445279359817505
loss:  0.5572296380996704
----------index12----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0401+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0200j],
        [0.0000+0.0200j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6050-0.3143j, 0.6415+0.3516j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4648, 0.5352]], grad_fn=<PowBackward0>)
loss:  0.6251944899559021
loss:  0.32741427421569824
loss:  0.8508796095848083
loss:  0.18782758712768555
----------index16----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0400+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0200j],
        [0.0000+0.0200j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6669-0.3087j, 0.6081+0.3003j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5401, 0.4599]], grad_fn=<PowBackward0>)
loss:  0.7766867280006409
loss:  0.5541526675224304
loss:  0.43258407711982727
loss:  0.030437486246228218
----------index20----------
train inputs:  tensor([[1.8331, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0401+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0200j],
        [0.0000+0.0200j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4876-0.3383j, 0.6548+0.4680j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3522, 0.6478]], grad_fn=<PowBackward0>)
loss:  0.43422409892082214
loss:  1.3074471950531006
loss:  0.3243370056152344
loss:  0.851833701133728
----------index24----------
train inputs:  tensor([[0.3873, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0405+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0203j],
        [0.0000+0.0203j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7761-0.5940j, 0.1648+0.1329j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9552, 0.0448]], grad_fn=<PowBackward0>)
loss:  0.045837078243494034
loss:  0.273175984621048
loss:  0.5564782023429871
loss:  0.0004160673706792295
----------index28----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0409+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0204j],
        [0.0000+0.0204j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6938-0.5290j, 0.3850+0.3011j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7611, 0.2389]], grad_fn=<PowBackward0>)
loss:  0.2729494273662567
loss:  0.13247895240783691
loss:  0.378081351518631
loss:  0.3247990906238556
----------index32----------
train inputs:  tensor([[1.6821, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0411+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0205j],
        [0.0000+0.0205j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5806-0.3007j, 0.6637+0.3634j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4275, 0.5725]], grad_fn=<PowBackward0>)
loss:  0.5578027367591858
loss:  0.10396815091371536
loss:  0.2851804494857788
loss:  0.37877437472343445
----------index36----------
train inputs:  tensor([[1.9106, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0413+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0207j],
        [0.0000+0.0207j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4616-0.3195j, 0.6734+0.4810j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3151, 0.6849]], grad_fn=<PowBackward0>)
loss:  0.3785085678100586
loss:  0.3251575231552124
loss:  0.5552433133125305
loss:  0.6911633610725403
----------index40----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0414+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0207j],
        [0.0000+0.0207j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5353-0.6005j, 0.3974+0.4415j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6471, 0.3529]], grad_fn=<PowBackward0>)
loss:  0.4352266490459442
loss:  0.6210152506828308
loss:  0.13283653557300568
loss:  0.33764833211898804
----------index44----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0415+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0208j],
        [0.0000+0.0208j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2441-0.1977j, 0.7300+0.6070j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0986, 0.9014]], grad_fn=<PowBackward0>)
loss:  0.10383906960487366
loss:  0.3774016499519348
loss:  0.23089145123958588
loss:  0.37806421518325806
----------index48----------
train inputs:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0416+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0208j],
        [0.0000+0.0208j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5625-0.4267j, 0.5596+0.4341j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4984, 0.5016]], grad_fn=<PowBackward0>)
loss:  0.6900274753570557
loss:  0.32446709275245667
loss:  0.49413684010505676
loss:  0.7783154845237732
----------index52----------
train inputs:  tensor([[1.0685, 0.0000]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.+0.j]])
rz_matrix:  tensor([[1.-0.j, 0.+0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0416+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0208j],
        [0.0000+0.0208j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8605+0.0106j, 0.5091+0.0179j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7405, 0.2595]], grad_fn=<PowBackward0>)
loss:  1.3491230010986328
loss:  0.14406903088092804
loss:  0.37888815999031067
loss:  0.04589149355888367
----------index56----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0416+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0208j],
        [0.0000+0.0208j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7933-0.6084j, 0.0127+0.0165j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9957e-01, 4.3339e-04]], grad_fn=<PowBackward0>)
loss:  0.00043347931932657957
loss:  0.5557751059532166
loss:  0.4304703176021576
loss:  0.3791537582874298
----------index60----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0417+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0208j],
        [0.0000+0.0208j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8100-0.3303j, 0.4421+0.1984j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7652, 0.2348]], grad_fn=<PowBackward0>)
loss:  1.4491695165634155
loss:  0.17816486954689026
loss:  0.2252635359764099
loss:  0.435708224773407
----------index64----------
train inputs:  tensor([[1.1512, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0418+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0209j],
        [0.0000+0.0209j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7522-0.3506j, 0.4988+0.2500j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6887, 0.3113]], grad_fn=<PowBackward0>)
loss:  1.166954755783081
loss:  0.49038976430892944
loss:  0.3255307078361511
loss:  0.6184399127960205
----------index68----------
train inputs:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0421+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0211j],
        [0.0000+0.0211j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6724-0.5551j, 0.3747+0.3151j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7603, 0.2397]], grad_fn=<PowBackward0>)
loss:  0.2740161120891571
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4461551904678345
------------------------------Epoch6------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.6821, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0422+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0211j],
        [0.0000+0.0211j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5804-0.3003j, 0.6638+0.3637j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4271, 0.5729]], grad_fn=<PowBackward0>)
loss:  0.5569836497306824
loss:  0.43601706624031067
loss:  0.14421112835407257
loss:  0.8532013297080994
----------index4----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0424+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0212j],
        [0.0000+0.0212j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4341-0.2997j, 0.6914+0.4936j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2782, 0.7218]], grad_fn=<PowBackward0>)
loss:  0.32607603073120117
loss:  0.5560004115104675
loss:  0.7777383327484131
loss:  0.6202043294906616
----------index8----------
train inputs:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0424+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0212j],
        [0.0000+0.0212j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4748-0.2997j, 0.6915+0.4546j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3152, 0.6848]], grad_fn=<PowBackward0>)
loss:  0.37865060567855835
loss:  0.6264169812202454
loss:  0.3777056932449341
loss:  0.1034729927778244
----------index12----------
train inputs:  tensor([[2.3514, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.3514]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.3514+0.j]])
ry_matrix:  tensor([[ 0.3849-0.j, -0.9230-0.j],
        [ 0.9230+0.j,  0.3849-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3849+0.j, 0.9230+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.3849+0.j, 0.9230+0.j]])
New state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0427+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0214j],
        [0.0000+0.0214j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2933-0.2185j, 0.7372+0.5681j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1338, 0.8662]], grad_fn=<PowBackward0>)
loss:  0.14365950226783752
loss:  0.23029762506484985
loss:  0.43631497025489807
loss:  0.3799242377281189
----------index16----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0430+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0215j],
        [0.0000+0.0215j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8076-0.2765j, 0.4861+0.1871j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7287, 0.2713]], grad_fn=<PowBackward0>)
loss:  1.3044644594192505
loss:  0.3260452151298523
loss:  0.3262067437171936
loss:  0.1787407100200653
----------index20----------
train inputs:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0430+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0215j],
        [0.0000+0.0215j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5504-0.6173j, 0.3763+0.4177j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6840, 0.3160]], grad_fn=<PowBackward0>)
loss:  0.37981441617012024
loss:  0.00046174455201253295
loss:  0.04634620621800423
loss:  0.4457472860813141
----------index24----------
train inputs:  tensor([[0.5513, 0.6797]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.5513+0.j]])
ry_matrix:  tensor([[ 0.9623-0.j, -0.2722-0.j],
        [ 0.2722+0.j,  0.9623-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9623+0.j, 0.2722+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.9623+0.j, 0.2722+0.j]])
New state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0428+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0214j],
        [0.0000+0.0214j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9051-0.3152j, 0.2634+0.1101j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9185, 0.0815]], grad_fn=<PowBackward0>)
loss:  0.08502349257469177
loss:  0.3781726062297821
loss:  0.2754766345024109
loss:  0.4306483566761017
----------index28----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0427+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0213j],
        [0.0000+0.0213j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4474-0.3375j, 0.6552+0.5066j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3141, 0.6859]], grad_fn=<PowBackward0>)
loss:  0.3769788146018982
loss:  0.43240541219711304
loss:  0.28462061285972595
loss:  0.27402064204216003
----------index32----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0429+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0215j],
        [0.0000+0.0215j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6963-0.4050j, 0.5057+0.3090j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6488, 0.3512]], grad_fn=<PowBackward0>)
loss:  1.0463647842407227
loss:  0.32602736353874207
loss:  0.3253357708454132
loss:  0.5546450018882751
----------index36----------
train inputs:  tensor([[1.3085, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3085+0.j]])
ry_matrix:  tensor([[ 0.7935-0.j, -0.6086-0.j],
        [ 0.6086+0.j,  0.7935-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935+0.j, 0.6086+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.7935+0.j, 0.6086+0.j]])
New state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0432+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0216j],
        [0.0000+0.0216j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4724-0.6215j, 0.3839+0.4932j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6094, 0.3906]], grad_fn=<PowBackward0>)
loss:  0.4953209459781647
loss:  0.6174082159996033
loss:  0.3791530430316925
loss:  0.6893912553787231
----------index40----------
train inputs:  tensor([[2.2519, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.2519]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.2519+0.j]])
ry_matrix:  tensor([[ 0.4303-0.j, -0.9027-0.j],
        [ 0.9027+0.j,  0.4303-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4303+0.j, 0.9027+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.4303+0.j, 0.9027+0.j]])
New state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0434+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0217j],
        [0.0000+0.0217j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3503-0.2178j, 0.7621+0.4991j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1701, 0.8299]], grad_fn=<PowBackward0>)
loss:  0.18645823001861572
loss:  0.27473318576812744
loss:  0.13359522819519043
loss:  0.22610564529895782
----------index44----------
train inputs:  tensor([[1.5338, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0435+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0217j],
        [0.0000+0.0217j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6119-0.3536j, 0.6050+0.3667j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4995, 0.5005]], grad_fn=<PowBackward0>)
loss:  0.6920640468597412
loss:  0.17894476652145386
loss:  0.4316394329071045
loss:  0.6881639361381531
----------index48----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0436+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0218j],
        [0.0000+0.0218j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7986-0.5630j, 0.1694+0.1285j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9548, 0.0452]], grad_fn=<PowBackward0>)
loss:  0.04628464952111244
loss:  0.5542970299720764
loss:  0.8481722474098206
loss:  0.029802881181240082
----------index52----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0439+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0219j],
        [0.0000+0.0219j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5239-0.5445j, 0.4549+0.4712j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5710, 0.4290]], grad_fn=<PowBackward0>)
loss:  0.5604126453399658
loss:  0.3267234265804291
loss:  0.27500444650650024
loss:  1.4462323188781738
----------index56----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0440+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0220j],
        [0.0000+0.0220j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4072-0.6380j, 0.3615+0.5445j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5728, 0.4272]], grad_fn=<PowBackward0>)
loss:  0.5572509765625
loss:  0.48879918456077576
loss:  0.0004844050563406199
loss:  0.13389842212200165
----------index60----------
train inputs:  tensor([[1.9904, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0441+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0220j],
        [0.0000+0.0220j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5186-0.1303j, 0.8103+0.2398j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2860, 0.7140]], grad_fn=<PowBackward0>)
loss:  0.33681032061576843
loss:  0.22640909254550934
loss:  0.10299763083457947
loss:  0.37904733419418335
----------index64----------
train inputs:  tensor([[1.0685, 0.0000]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.+0.j]])
rz_matrix:  tensor([[1.-0.j, 0.+0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0441+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0221j],
        [0.0000+0.0221j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8605+0.0112j, 0.5091+0.0190j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7405, 0.2595]], grad_fn=<PowBackward0>)
loss:  1.3490239381790161
loss:  0.13364993035793304
loss:  1.1643651723861694
loss:  0.6221003532409668
----------index68----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0442+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0221j],
        [0.0000+0.0221j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6663-0.3074j, 0.6087+0.3017j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5385, 0.4615]], grad_fn=<PowBackward0>)
loss:  0.7731737494468689
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4463098347187042
------------------------------Epoch7------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0443+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0221j],
        [0.0000+0.0221j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4470-0.3369j, 0.6555+0.5069j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3133, 0.6867]], grad_fn=<PowBackward0>)
loss:  0.37591680884361267
loss:  0.18602551519870758
loss:  0.3793068528175354
loss:  0.0465044230222702
----------index4----------
train inputs:  tensor([[2.1598, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.1598+0.j]])
ry_matrix:  tensor([[ 0.4714-0.j, -0.8819-0.j],
        [ 0.8819+0.j,  0.4714-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4714+0.j, 0.8819+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.4714+0.j, 0.8819+0.j]])
New state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0447+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0223j],
        [0.0000+0.0223j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3734-0.2560j, 0.7260+0.5176j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2050, 0.7950]], grad_fn=<PowBackward0>)
loss:  0.22940121591091156
loss:  0.5578852891921997
loss:  0.7758495211601257
loss:  0.08543461561203003
----------index8----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0449+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0225j],
        [0.0000+0.0225j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4335-0.2988j, 0.6918+0.4942j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2772, 0.7228]], grad_fn=<PowBackward0>)
loss:  0.3245774209499359
loss:  0.3272484838962555
loss:  0.27562040090560913
loss:  0.14320331811904907
----------index12----------
train inputs:  tensor([[1.3845, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0225j],
        [0.0000+0.0225j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6019-0.4570j, 0.5169+0.4021j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5711, 0.4289]], grad_fn=<PowBackward0>)
loss:  0.8465696573257446
loss:  0.5548701286315918
loss:  0.10262902081012726
loss:  0.000514460785780102
----------index16----------
train inputs:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0455+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0227j],
        [0.0000+0.0227j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5616-0.4256j, 0.5604+0.4352j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4966, 0.5034]], grad_fn=<PowBackward0>)
loss:  0.6863107085227966
loss:  0.5619122385978699
loss:  1.1624969244003296
loss:  0.44461148977279663
----------index20----------
train inputs:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0459+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0230j],
        [0.0000+0.0230j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4740-0.6775j, 0.3299+0.4554j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6837, 0.3163]], grad_fn=<PowBackward0>)
loss:  0.38020220398902893
loss:  0.1345488727092743
loss:  0.6148408055305481
loss:  0.2762500047683716
----------index24----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0462+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0231j],
        [0.0000+0.0231j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4733-0.1509j, 0.8151+0.2979j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2468, 0.7532]], grad_fn=<PowBackward0>)
loss:  0.2834049463272095
loss:  0.8572137951850891
loss:  1.443081259727478
loss:  0.6895241737365723
----------index28----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6383+0.j, 0.7698+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0465+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0233j],
        [0.0000+0.0233j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4954-0.3741j, 0.6197+0.4801j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3854, 0.6146]], grad_fn=<PowBackward0>)
loss:  0.4868529736995697
loss:  0.42967602610588074
loss:  0.3283654451370239
loss:  0.5595858097076416
----------index32----------
train inputs:  tensor([[1.8331, 1.6078]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0470+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0235j],
        [0.0000+0.0235j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4088-0.4252j, 0.5607+0.5811j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3479, 0.6521]], grad_fn=<PowBackward0>)
loss:  0.427482545375824
loss:  0.3286861777305603
loss:  0.3748151659965515
loss:  0.5515759587287903
----------index36----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0473+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0236j],
        [0.0000+0.0236j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6112-0.5884j, 0.3807+0.3679j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7198, 0.2802]], grad_fn=<PowBackward0>)
loss:  0.32883182168006897
loss:  1.041050672531128
loss:  0.3755478858947754
loss:  0.6193905472755432
----------index40----------
train inputs:  tensor([[1.3085, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3085+0.j]])
ry_matrix:  tensor([[ 0.7935-0.j, -0.6086-0.j],
        [ 0.6086+0.j,  0.7935-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935+0.j, 0.6086+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.7935+0.j, 0.6086+0.j]])
New state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0478+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0239j],
        [0.0000+0.0239j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4712-0.6206j, 0.3853+0.4943j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6072, 0.3928]], grad_fn=<PowBackward0>)
loss:  0.4988817870616913
loss:  0.27256569266319275
loss:  0.440060555934906
loss:  0.7699019312858582
----------index44----------
train inputs:  tensor([[1.2310, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0482+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0241j],
        [0.0000+0.0241j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5564-0.5781j, 0.4147+0.4293j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6438, 0.3562]], grad_fn=<PowBackward0>)
loss:  0.4403863847255707
loss:  0.13548287749290466
loss:  0.22851063311100006
loss:  0.2769702672958374
----------index48----------
train inputs:  tensor([[0.6797, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0483+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0241j],
        [0.0000+0.0241j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7204-0.5954j, 0.2710+0.2302j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8735, 0.1265]], grad_fn=<PowBackward0>)
loss:  0.13520342111587524
loss:  0.32842230796813965
loss:  0.6316440105438232
loss:  0.5509275197982788
----------index52----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0480+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0240j],
        [0.0000+0.0240j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5000-0.6575j, 0.3472+0.4441j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6823, 0.3177]], grad_fn=<PowBackward0>)
loss:  0.3822782039642334
loss:  0.3833002746105194
loss:  0.6156100034713745
loss:  0.18081216514110565
----------index56----------
train inputs:  tensor([[1.9904, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0477+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0238j],
        [0.0000+0.0238j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5182-0.1289j, 0.8105+0.2407j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2851, 0.7149]], grad_fn=<PowBackward0>)
loss:  0.3356460928916931
loss:  0.43416282534599304
loss:  0.10188039392232895
loss:  0.029163340106606483
----------index60----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0475+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0237j],
        [0.0000+0.0237j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7933-0.6084j, 0.0145+0.0188j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9944e-01, 5.6379e-04]], grad_fn=<PowBackward0>)
loss:  0.0005639593582600355
loss:  0.3828051686286926
loss:  1.3488848209381104
loss:  1.299883246421814
----------index64----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9230+0.j, 0.3849+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9230+0.j, 0.3849+0.j]])
New state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0473+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0237j],
        [0.0000+0.0237j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6817-0.6083j, 0.3014+0.2728j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8348, 0.1652]], grad_fn=<PowBackward0>)
loss:  0.18062278628349304
loss:  0.22803029417991638
loss:  0.6856438517570496
loss:  0.14193695783615112
----------index68----------
train inputs:  tensor([[0.3873, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0473+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0237j],
        [0.0000+0.0237j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7757-0.5934j, 0.1668+0.1355j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9538, 0.0462]], grad_fn=<PowBackward0>)
loss:  0.04728112742304802
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.44653958082199097
------------------------------Epoch8------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0473+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0237j],
        [0.0000+0.0237j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2423-0.1955j, 0.7306+0.6077j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0969, 0.9031]], grad_fn=<PowBackward0>)
loss:  0.10196355730295181
loss:  0.8582671284675598
loss:  0.18061357736587524
loss:  0.8441084623336792
----------index4----------
train inputs:  tensor([[1.2310, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0473+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0236j],
        [0.0000+0.0236j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5566-0.5783j, 0.4144+0.4290j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6442, 0.3558]], grad_fn=<PowBackward0>)
loss:  0.4397314786911011
loss:  0.2768595814704895
loss:  0.5598363876342773
loss:  0.32874563336372375
----------index8----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0471+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0235j],
        [0.0000+0.0235j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6928-0.5278j, 0.3866+0.3033j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7586, 0.2414]], grad_fn=<PowBackward0>)
loss:  0.27631428837776184
loss:  0.5596328377723694
loss:  0.0005488113383762538
loss:  0.4391331076622009
----------index12----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0466+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0233j],
        [0.0000+0.0233j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5784-0.4024j, 0.5761+0.4142j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4965, 0.5035]], grad_fn=<PowBackward0>)
loss:  0.68626868724823
loss:  0.18515543639659882
loss:  0.3812685012817383
loss:  0.2275650054216385
----------index16----------
train inputs:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0463+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0232j],
        [0.0000+0.0232j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4739-0.2983j, 0.6920+0.4555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3136, 0.6864]], grad_fn=<PowBackward0>)
loss:  0.3762681782245636
loss:  0.3804124891757965
loss:  0.38193756341934204
loss:  0.7748615741729736
----------index20----------
train inputs:  tensor([[0.6797, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0460+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0230j],
        [0.0000+0.0230j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6485-0.6734j, 0.2469+0.2550j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8740, 0.1260]], grad_fn=<PowBackward0>)
loss:  0.13464461266994476
loss:  0.0005282366182655096
loss:  0.32780715823173523
loss:  0.6172930598258972
----------index24----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0458+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0229j],
        [0.0000+0.0229j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6975-0.6227j, 0.2628+0.2383j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8742, 0.1258]], grad_fn=<PowBackward0>)
loss:  0.13446316123008728
loss:  0.42838624119758606
loss:  1.162429928779602
loss:  0.4874268174171448
----------index28----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0458+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0229j],
        [0.0000+0.0229j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7985-0.5628j, 0.1701+0.1294j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9543, 0.0457]], grad_fn=<PowBackward0>)
loss:  0.04675578325986862
loss:  0.6295130252838135
loss:  0.5543488264083862
loss:  0.22881600260734558
----------index32----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0460+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0230j],
        [0.0000+0.0230j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5404-0.4090j, 0.5809+0.4508j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4593, 0.5407]], grad_fn=<PowBackward0>)
loss:  0.6149431467056274
loss:  0.04701083153486252
loss:  0.18007783591747284
loss:  0.4332365393638611
----------index36----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0462+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0231j],
        [0.0000+0.0231j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6040-0.3124j, 0.6424+0.3535j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4623, 0.5377]], grad_fn=<PowBackward0>)
loss:  0.6205119490623474
loss:  1.4432436227798462
loss:  0.13446737825870514
loss:  0.3753000795841217
----------index40----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0464+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0232j],
        [0.0000+0.0232j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5951-0.5728j, 0.4054+0.3916j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6823, 0.3177]], grad_fn=<PowBackward0>)
loss:  0.3822857141494751
loss:  0.4443444013595581
loss:  0.2764575481414795
loss:  1.300681471824646
----------index44----------
train inputs:  tensor([[1.8331, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0467+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0233j],
        [0.0000+0.0233j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4861-0.3362j, 0.6559+0.4696j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3493, 0.6507]], grad_fn=<PowBackward0>)
loss:  0.42967483401298523
loss:  0.27320021390914917
loss:  0.6849779486656189
loss:  0.3233814835548401
----------index48----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0471+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0236j],
        [0.0000+0.0236j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5884-0.6113j, 0.3678+0.3806j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7198, 0.2802]], grad_fn=<PowBackward0>)
loss:  0.3287216126918793
loss:  1.3488917350769043
loss:  0.14192156493663788
loss:  1.0409795045852661
----------index52----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0476+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0238j],
        [0.0000+0.0238j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6188-0.6427j, 0.3140+0.3247j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7960, 0.2040]], grad_fn=<PowBackward0>)
loss:  0.22815458476543427
loss:  0.33565494418144226
loss:  0.3736444413661957
loss:  0.49898281693458557
----------index56----------
train inputs:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0480+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0240j],
        [0.0000+0.0240j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4735-0.6772j, 0.3306+0.4559j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6828, 0.3172]], grad_fn=<PowBackward0>)
loss:  0.3815231919288635
loss:  0.3283045291900635
loss:  0.5509411692619324
loss:  0.14208760857582092
----------index60----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0481+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0241j],
        [0.0000+0.0241j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4730-0.1501j, 0.8153+0.2984j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2463, 0.7537]], grad_fn=<PowBackward0>)
loss:  0.2827373445034027
loss:  0.32923510670661926
loss:  0.7697586417198181
loss:  0.6878641247749329
----------index64----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0484+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0242j],
        [0.0000+0.0242j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2420-0.1951j, 0.7307+0.6078j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0966, 0.9034]], grad_fn=<PowBackward0>)
loss:  0.10161835700273514
loss:  0.564433217048645
loss:  0.08617193251848221
loss:  0.5505372285842896
----------index68----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.1925+0.j, 0.9813+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0486+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0243j],
        [0.0000+0.0243j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1329-0.1044j, 0.7582+0.6298j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0286, 0.9714]], grad_fn=<PowBackward0>)
loss:  0.02897600084543228
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.44664695858955383
------------------------------Epoch9------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0487+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0244j],
        [0.0000+0.0244j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7933-0.6084j, 0.0148+0.0193j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9941e-01, 5.9310e-04]], grad_fn=<PowBackward0>)
loss:  0.0005933017819188535
loss:  0.6842593550682068
loss:  0.2287950962781906
loss:  0.04761800915002823
----------index4----------
train inputs:  tensor([[1.8331, 1.6078]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0489+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0245j],
        [0.0000+0.0245j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4082-0.4246j, 0.5611+0.5815j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3469, 0.6531]], grad_fn=<PowBackward0>)
loss:  0.42606890201568604
loss:  0.2773516774177551
loss:  0.5648820400238037
loss:  0.6324358582496643
----------index8----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0490+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0245j],
        [0.0000+0.0245j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6035-0.3115j, 0.6429+0.3543j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4612, 0.5388]], grad_fn=<PowBackward0>)
loss:  0.6183419227600098
loss:  0.1413012444972992
loss:  0.7691305875778198
loss:  0.181369811296463
----------index12----------
train inputs:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0490+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0245j],
        [0.0000+0.0245j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6814-0.2717j, 0.6222+0.2734j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5382, 0.4618]], grad_fn=<PowBackward0>)
loss:  0.7725793123245239
loss:  0.13551530241966248
loss:  0.4279773235321045
loss:  0.4411207437515259
----------index16----------
train inputs:  tensor([[0.5513, 0.6797]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.5513+0.j]])
ry_matrix:  tensor([[ 0.9623-0.j, -0.2722-0.j],
        [ 0.2722+0.j,  0.9623-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9623+0.j, 0.2722+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.9623+0.j, 0.2722+0.j]])
New state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0492+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0246j],
        [0.0000+0.0246j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9047-0.3143j, 0.2644+0.1130j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9173, 0.0827]], grad_fn=<PowBackward0>)
loss:  0.08630025386810303
loss:  0.374500572681427
loss:  0.27794021368026733
loss:  0.5614147186279297
----------index20----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0492+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0246j],
        [0.0000+0.0246j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6970-0.6222j, 0.2638+0.2394j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8731, 0.1269]], grad_fn=<PowBackward0>)
loss:  0.13575436174869537
loss:  0.8601354360580444
loss:  0.10138936340808868
loss:  0.18412092328071594
----------index24----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0490+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0245j],
        [0.0000+0.0245j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5336-0.5990j, 0.3997+0.4435j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6435, 0.3565]], grad_fn=<PowBackward0>)
loss:  0.44083163142204285
loss:  0.3840268850326538
loss:  0.3736717104911804
loss:  0.38210558891296387
----------index28----------
train inputs:  tensor([[2.1598, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.1598+0.j]])
ry_matrix:  tensor([[ 0.4714-0.j, -0.8819-0.j],
        [ 0.8819+0.j,  0.4714-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4714+0.j, 0.8819+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.4714+0.j, 0.8819+0.j]])
New state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0488+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0244j],
        [0.0000+0.0244j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3724-0.2545j, 0.7265+0.5184j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2034, 0.7966]], grad_fn=<PowBackward0>)
loss:  0.22742964327335358
loss:  0.1812664270401001
loss:  0.37301570177078247
loss:  0.02896219491958618
----------index32----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0487+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0244j],
        [0.0000+0.0244j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7983-0.5626j, 0.1709+0.1306j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9537, 0.0463]], grad_fn=<PowBackward0>)
loss:  0.0473608672618866
loss:  1.158979058265686
loss:  1.0394407510757446
loss:  0.3353000581264496
----------index36----------
train inputs:  tensor([[1.6821, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0488+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0244j],
        [0.0000+0.0244j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5792-0.2981j, 0.6648+0.3656j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4243, 0.5757]], grad_fn=<PowBackward0>)
loss:  0.5522353053092957
loss:  1.3488165140151978
loss:  1.4395973682403564
loss:  0.49992138147354126
----------index40----------
train inputs:  tensor([[1.0685, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0492+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0246j],
        [0.0000+0.0246j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6330-0.5643j, 0.3935+0.3551j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7190, 0.2810]], grad_fn=<PowBackward0>)
loss:  0.3298402428627014
loss:  0.6870589256286621
loss:  0.32991185784339905
loss:  0.549969494342804
----------index44----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0494+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0247j],
        [0.0000+0.0247j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8070-0.2749j, 0.4870+0.1897j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7268, 0.2732]], grad_fn=<PowBackward0>)
loss:  1.2977160215377808
loss:  0.5498542785644531
loss:  0.8415327072143555
loss:  0.5618187785148621
----------index48----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0498+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0249j],
        [0.0000+0.0249j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5879-0.6108j, 0.3686+0.3814j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7186, 0.2814]], grad_fn=<PowBackward0>)
loss:  0.33040696382522583
loss:  0.3216957449913025
loss:  0.32947391271591187
loss:  0.0006253289757296443
----------index52----------
train inputs:  tensor([[2.3514, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.3514]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.3514+0.j]])
ry_matrix:  tensor([[ 0.3849-0.j, -0.9230-0.j],
        [ 0.9230+0.j,  0.3849-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3849+0.j, 0.9230+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.3849+0.j, 0.9230+0.j]])
New state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0501+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0250j],
        [0.0000+0.0250j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3008-0.2033j, 0.7589+0.5406j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1318, 0.8682]], grad_fn=<PowBackward0>)
loss:  0.14136852324008942
loss:  0.3846046030521393
loss:  0.38290736079216003
loss:  0.6136714220046997
----------index56----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0502+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0251j],
        [0.0000+0.0251j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5800-0.1464j, 0.7675+0.2306j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3579, 0.6421]], grad_fn=<PowBackward0>)
loss:  0.44293737411499023
loss:  0.6111867427825928
loss:  0.10102332383394241
loss:  0.2711998522281647
----------index60----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0504+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0252j],
        [0.0000+0.0252j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6183-0.6423j, 0.3149+0.3256j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7949, 0.2051]], grad_fn=<PowBackward0>)
loss:  0.22959092259407043
loss:  0.33080077171325684
loss:  0.278645783662796
loss:  0.43591514229774475
----------index64----------
train inputs:  tensor([[0.6797, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0505+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0252j],
        [0.0000+0.0252j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6479-0.6728j, 0.2484+0.2565j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8725, 0.1275]], grad_fn=<PowBackward0>)
loss:  0.13633714616298676
loss:  0.28193241357803345
loss:  0.6815450191497803
loss:  0.38389822840690613
----------index68----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6383+0.j, 0.7698+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0505+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0252j],
        [0.0000+0.0252j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4945-0.3729j, 0.6204+0.4811j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3836, 0.6164]], grad_fn=<PowBackward0>)
loss:  0.48384466767311096
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.44678518176078796
------------------------------Epoch10------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0505+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0252j],
        [0.0000+0.0252j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4454-0.3349j, 0.6565+0.5083j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3106, 0.6894]], grad_fn=<PowBackward0>)
loss:  0.3718942701816559
loss:  1.2965503931045532
loss:  0.18205317854881287
loss:  0.13608470559120178
----------index4----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0506+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0253j],
        [0.0000+0.0253j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4726-0.1491j, 0.8155+0.2989j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2456, 0.7544]], grad_fn=<PowBackward0>)
loss:  0.2818688750267029
loss:  0.5625585317611694
loss:  0.38517725467681885
loss:  0.37257257103919983
----------index8----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0507+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0253j],
        [0.0000+0.0253j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6106-0.5877j, 0.3817+0.3689j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7183, 0.2817]], grad_fn=<PowBackward0>)
loss:  0.33093497157096863
loss:  0.4360203146934509
loss:  0.5011101961135864
loss:  0.14117233455181122
----------index12----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
New state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0506+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0253j],
        [0.0000+0.0253j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0169+0.0188j,  0.7451+0.6665j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[6.3907e-04, 9.9936e-01]], grad_fn=<PowBackward0>)
loss:  0.0006394045776687562
loss:  0.3736730217933655
loss:  0.27108344435691833
loss:  0.3306831419467926
----------index16----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0505+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0253j],
        [0.0000+0.0253j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2413-0.1944j, 0.7309+0.6081j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0960, 0.9040]], grad_fn=<PowBackward0>)
loss:  0.10093609243631363
loss:  0.028661411255598068
loss:  0.14071974158287048
loss:  0.5490670800209045
----------index20----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0506+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0253j],
        [0.0000+0.0253j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8091-0.3283j, 0.4435+0.2020j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7625, 0.2375]], grad_fn=<PowBackward0>)
loss:  1.437544584274292
loss:  0.5625376105308533
loss:  0.08660231530666351
loss:  0.18345719575881958
----------index24----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0507+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0254j],
        [0.0000+0.0254j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6969-0.6220j, 0.2643+0.2400j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8726, 0.1274]], grad_fn=<PowBackward0>)
loss:  0.13633455336093903
loss:  0.3299504816532135
loss:  0.13644427061080933
loss:  0.3346704840660095
----------index28----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0508+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0254j],
        [0.0000+0.0254j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6653-0.3054j, 0.6097+0.3039j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5359, 0.4641]], grad_fn=<PowBackward0>)
loss:  0.7676563262939453
loss:  1.0369988679885864
loss:  0.4835645854473114
loss:  0.4424076974391937
----------index32----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0509+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7932-0.6084j, 0.0155+0.0202j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9935e-01, 6.4834e-04]], grad_fn=<PowBackward0>)
loss:  0.0006485299672931433
loss:  0.8619689345359802
loss:  0.1822328269481659
loss:  1.1563493013381958
----------index36----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0510+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5332-0.5986j, 0.4003+0.4441j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6426, 0.3574]], grad_fn=<PowBackward0>)
loss:  0.4422752261161804
loss:  0.22989098727703094
loss:  1.348720908164978
loss:  0.634269654750824
----------index40----------
train inputs:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0509+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5487-0.6158j, 0.3787+0.4198j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6803, 0.3197]], grad_fn=<PowBackward0>)
loss:  0.38517338037490845
loss:  0.04805180802941322
loss:  0.22647300362586975
loss:  0.5508295893669128
----------index44----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0508+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0254j],
        [0.0000+0.0254j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5639-0.3230j, 0.6499+0.3940j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4224, 0.5776]], grad_fn=<PowBackward0>)
loss:  0.5488688349723816
loss:  0.42468395829200745
loss:  0.38415658473968506
loss:  0.6130577921867371
----------index48----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0509+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0254j],
        [0.0000+0.0254j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5393-0.4076j, 0.5819+0.4521j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4570, 0.5430]], grad_fn=<PowBackward0>)
loss:  0.6105701327323914
loss:  0.2298634648323059
loss:  0.27891674637794495
loss:  0.7710912227630615
----------index52----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0510+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4319-0.2967j, 0.6927+0.4955j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2746, 0.7254]], grad_fn=<PowBackward0>)
loss:  0.3210437595844269
loss:  0.2789667844772339
loss:  0.5666908025741577
loss:  0.3835241496562958
----------index56----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0511+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2412-0.1942j, 0.7310+0.6081j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0959, 0.9041]], grad_fn=<PowBackward0>)
loss:  0.1007639467716217
loss:  0.3835093677043915
loss:  0.3311660885810852
loss:  0.44261300563812256
----------index60----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0510+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7981-0.5624j, 0.1715+0.1315j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9533, 0.0467]], grad_fn=<PowBackward0>)
loss:  0.0478377602994442
loss:  0.3309420049190521
loss:  0.42674168944358826
loss:  0.6811078190803528
----------index64----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0509+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0254j],
        [0.0000+0.0254j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5776-0.4012j, 0.5770+0.4155j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4945, 0.5055]], grad_fn=<PowBackward0>)
loss:  0.6822556853294373
loss:  0.6168397665023804
loss:  0.27845245599746704
loss:  0.6855043768882751
----------index68----------
train inputs:  tensor([[1.3845, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0511+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0255j],
        [0.0000+0.0255j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6007-0.4554j, 0.5183+0.4039j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5683, 0.4317]], grad_fn=<PowBackward0>)
loss:  0.8399109840393066
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.446836918592453
------------------------------Epoch11------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.2310, 2.1598]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.1598+0.j]])
rz_matrix:  tensor([[0.4714-0.8819j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.4714+0.8819j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0511+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0256j],
        [0.0000+0.0256j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3718-0.7129j, 0.2905+0.5188j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6464, 0.3536]], grad_fn=<PowBackward0>)
loss:  0.4363133907318115
loss:  0.3310759663581848
loss:  0.48328736424446106
loss:  0.6807976365089417
----------index4----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0513+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0256j],
        [0.0000+0.0256j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6968-0.6220j, 0.2645+0.2402j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8724, 0.1276]], grad_fn=<PowBackward0>)
loss:  0.1365385502576828
loss:  0.3854203224182129
loss:  0.38446924090385437
loss:  1.2956944704055786
----------index8----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0514+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0257j],
        [0.0000+0.0257j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5331-0.5985j, 0.4004+0.4442j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6424, 0.3576]], grad_fn=<PowBackward0>)
loss:  0.44254323840141296
loss:  0.3313664197921753
loss:  0.04815074801445007
loss:  1.4365438222885132
----------index12----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0514+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0257j],
        [0.0000+0.0257j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5638-0.3229j, 0.6500+0.3941j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4222, 0.5778]], grad_fn=<PowBackward0>)
loss:  0.548456072807312
loss:  0.3713047206401825
loss:  0.14086787402629852
loss:  1.3486977815628052
----------index16----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0515+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6922-0.5269j, 0.3878+0.3048j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7567, 0.2433]], grad_fn=<PowBackward0>)
loss:  0.2787388861179352
loss:  0.18248116970062256
loss:  0.8625596165657043
loss:  0.3314777612686157
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0515+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5638-0.3228j, 0.6500+0.3942j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4221, 0.5779]], grad_fn=<PowBackward0>)
loss:  0.5483393669128418
loss:  0.13673487305641174
loss:  0.5503407120704651
loss:  0.0006634409073740244
----------index24----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
New state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0515+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0172+0.0192j,  0.7451+0.6664j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[6.6331e-04, 9.9934e-01]], grad_fn=<PowBackward0>)
loss:  0.0006635005702264607
loss:  0.14035095274448395
loss:  0.02849513851106167
loss:  0.37201815843582153
----------index28----------
train inputs:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0516+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6811-0.2709j, 0.6225+0.2742j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5373, 0.4627]], grad_fn=<PowBackward0>)
loss:  0.7706460952758789
loss:  0.08678991347551346
loss:  0.2302120178937912
loss:  0.3838824927806854
----------index32----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0516+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5391-0.4074j, 0.5821+0.4523j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4566, 0.5434]], grad_fn=<PowBackward0>)
loss:  0.6099047660827637
loss:  0.1825377494096756
loss:  0.33050277829170227
loss:  0.1364813596010208
----------index36----------
train inputs:  tensor([[1.1512, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0516+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7509-0.3482j, 0.5005+0.2537j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6851, 0.3149]], grad_fn=<PowBackward0>)
loss:  1.1555558443069458
loss:  0.5671952366828918
loss:  0.44297829270362854
loss:  0.2792898416519165
----------index40----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9904+0.j]])
rz_matrix:  tensor([[0.5443-0.8389j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5443+0.8389j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0516+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4051-0.6366j, 0.3640+0.5461j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5693, 0.4307]], grad_fn=<PowBackward0>)
loss:  0.563310980796814
loss:  0.04796275496482849
loss:  0.2261502593755722
loss:  0.6125156879425049
----------index44----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0515+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0257j],
        [0.0000+0.0257j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4318-0.2965j, 0.6928+0.4956j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2744, 0.7256]], grad_fn=<PowBackward0>)
loss:  0.3207654058933258
loss:  0.42419108748435974
loss:  0.38380321860313416
loss:  0.10062011331319809
----------index48----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0515+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5774-0.4010j, 0.5771+0.4156j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4942, 0.5058]], grad_fn=<PowBackward0>)
loss:  0.6816762685775757
loss:  0.42630448937416077
loss:  0.7669574022293091
loss:  0.3858359456062317
----------index52----------
train inputs:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0517+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0258j],
        [0.0000+0.0258j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6709-0.5534j, 0.3773+0.3183j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7563, 0.2437]], grad_fn=<PowBackward0>)
loss:  0.2793041169643402
loss:  0.37297502160072327
loss:  0.2704293429851532
loss:  0.6349862813949585
----------index56----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0518+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0259j],
        [0.0000+0.0259j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6949-0.4027j, 0.5075+0.3121j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6451, 0.3549]], grad_fn=<PowBackward0>)
loss:  1.0358381271362305
loss:  0.10053515434265137
loss:  0.3314822316169739
loss:  0.83904629945755
----------index60----------
train inputs:  tensor([[1.5338, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0519+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0259j],
        [0.0000+0.0259j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6104-0.3510j, 0.6065+0.3693j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4958, 0.5042]], grad_fn=<PowBackward0>)
loss:  0.6847497820854187
loss:  0.3342927098274231
loss:  0.56360924243927
loss:  0.2813866138458252
----------index64----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0521+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0260j],
        [0.0000+0.0260j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5798-0.1457j, 0.7676+0.2311j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3574, 0.6426]], grad_fn=<PowBackward0>)
loss:  0.442210853099823
loss:  0.1828913688659668
loss:  0.230471670627594
loss:  0.5023019909858704
----------index68----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0522+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0261j],
        [0.0000+0.0261j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6029-0.3104j, 0.6434+0.3553j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4598, 0.5402]], grad_fn=<PowBackward0>)
loss:  0.6158905625343323
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.4469217360019684
------------------------------Epoch12------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0522+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0261j],
        [0.0000+0.0261j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6651-0.3049j, 0.6099+0.3043j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5353, 0.4647]], grad_fn=<PowBackward0>)
loss:  0.7664450407028198
loss:  0.37076613306999207
loss:  0.2796345353126526
loss:  0.3851003348827362
----------index4----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6383+0.j, 0.7698+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0523+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0261j],
        [0.0000+0.0261j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4941-0.3723j, 0.6208+0.4816j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3827, 0.6173]], grad_fn=<PowBackward0>)
loss:  0.48245444893836975
loss:  0.0006840183632448316
loss:  0.37152576446533203
loss:  0.38612881302833557
----------index8----------
train inputs:  tensor([[2.1598, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.1598]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.1598+0.j]])
ry_matrix:  tensor([[ 0.4714-0.j, -0.8819-0.j],
        [ 0.8819+0.j,  0.4714-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.4714+0.j, 0.8819+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.4714+0.j, 0.8819+0.j]])
New state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0524+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0262j],
        [0.0000+0.0262j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3714-0.2532j, 0.7270+0.5191j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2021, 0.7979]], grad_fn=<PowBackward0>)
loss:  0.2257612943649292
loss:  0.42355844378471375
loss:  0.44208043813705444
loss:  0.609214186668396
----------index12----------
train inputs:  tensor([[1.0685, 0.0000]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.+0.j]])
rz_matrix:  tensor([[1.-0.j, 0.+0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0525+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0262j],
        [0.0000+0.0262j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8604+0.0134j, 0.5090+0.0226j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7404, 0.2596]], grad_fn=<PowBackward0>)
loss:  1.348650574684143
loss:  0.5025543570518494
loss:  0.2812170684337616
loss:  0.3844565451145172
----------index16----------
train inputs:  tensor([[1.3845, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0525+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6004-0.4550j, 0.5186+0.4044j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5675, 0.4325]], grad_fn=<PowBackward0>)
loss:  0.8382768630981445
loss:  0.23068867623806
loss:  0.2793256938457489
loss:  0.6841410398483276
----------index20----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9230+0.j, 0.3849+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9230+0.j, 0.3849+0.j]])
New state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6809-0.6075j, 0.3030+0.2746j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8328, 0.1672]], grad_fn=<PowBackward0>)
loss:  0.18295685946941376
loss:  0.5641053318977356
loss:  0.38650402426719666
loss:  0.04841991513967514
----------index24----------
train inputs:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6708-0.5532j, 0.3776+0.3186j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7559, 0.2441]], grad_fn=<PowBackward0>)
loss:  0.27982020378112793
loss:  0.0006909372750669718
loss:  0.5475653409957886
loss:  0.08698385208845139
----------index28----------
train inputs:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0525+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4725-0.2962j, 0.6930+0.4570j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3110, 0.6890]], grad_fn=<PowBackward0>)
loss:  0.37244704365730286
loss:  0.028326746076345444
loss:  1.034894585609436
loss:  0.18269945681095123
----------index32----------
train inputs:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4725-0.6764j, 0.3322+0.4570j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6808, 0.3192]], grad_fn=<PowBackward0>)
loss:  0.384494811296463
loss:  0.7698523998260498
loss:  0.6358067989349365
loss:  0.10026891529560089
----------index36----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6102-0.5874j, 0.3822+0.3695j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7174, 0.2826]], grad_fn=<PowBackward0>)
loss:  0.3321629762649536
loss:  0.5641224980354309
loss:  0.32011616230010986
loss:  0.1368422955274582
----------index40----------
train inputs:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5716-0.3617j, 0.6138+0.4071j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4575, 0.5425]], grad_fn=<PowBackward0>)
loss:  0.6115866303443909
loss:  0.4255731701850891
loss:  0.33198702335357666
loss:  0.33406901359558105
----------index44----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0526+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5636-0.3224j, 0.6502+0.3945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4216, 0.5784]], grad_fn=<PowBackward0>)
loss:  0.5474993586540222
loss:  0.10025699436664581
loss:  0.33219248056411743
loss:  0.13718251883983612
----------index48----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0527+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0263j],
        [0.0000+0.0263j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6028-0.3103j, 0.6434+0.3555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4596, 0.5404]], grad_fn=<PowBackward0>)
loss:  0.615497350692749
loss:  0.2698751986026764
loss:  0.6793712973594666
loss:  0.6805405020713806
----------index52----------
train inputs:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0528+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5636-0.6323j, 0.3563+0.3945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7174, 0.2826]], grad_fn=<PowBackward0>)
loss:  0.33208155632019043
loss:  0.14036624133586884
loss:  0.8638818264007568
loss:  1.434592843055725
----------index56----------
train inputs:  tensor([[1.0685, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6745-0.5129j, 0.4177+0.3278j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7180, 0.2820]], grad_fn=<PowBackward0>)
loss:  0.33123424649238586
loss:  0.04824206605553627
loss:  1.2940419912338257
loss:  0.549333930015564
----------index60----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6966-0.6217j, 0.2650+0.2407j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8718, 0.1282]], grad_fn=<PowBackward0>)
loss:  0.1371808797121048
loss:  0.18312549591064453
loss:  0.1398015320301056
loss:  0.5683729648590088
----------index64----------
train inputs:  tensor([[1.2310, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5553-0.5771j, 0.4161+0.4306j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6415, 0.3585]], grad_fn=<PowBackward0>)
loss:  0.4439927339553833
loss:  1.1539803743362427
loss:  0.43748217821121216
loss:  0.23092404007911682
----------index68----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5327-0.5982j, 0.4009+0.4446j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6416, 0.3584]], grad_fn=<PowBackward0>)
loss:  0.4437806308269501
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.4469863176345825
------------------------------Epoch13------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5771-0.4006j, 0.5774+0.4161j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4935, 0.5065]], grad_fn=<PowBackward0>)
loss:  0.6802998781204224
loss:  0.42309898138046265
loss:  0.10014531761407852
loss:  0.3710872530937195
----------index4----------
train inputs:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4724-0.6764j, 0.3323+0.4571j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6806, 0.3194]], grad_fn=<PowBackward0>)
loss:  0.3847801089286804
loss:  0.2810344696044922
loss:  0.04827352985739708
loss:  0.43749508261680603
----------index8----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6179-0.6419j, 0.3157+0.3264j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7938, 0.2062]], grad_fn=<PowBackward0>)
loss:  0.23093357682228088
loss:  0.04851532727479935
loss:  0.6837498545646667
loss:  0.13731631636619568
----------index12----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5797-0.1453j, 0.7677+0.2314j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3571, 0.6429]], grad_fn=<PowBackward0>)
loss:  0.44183608889579773
loss:  0.7657468914985657
loss:  1.3486217260360718
loss:  0.37213757634162903
----------index16----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.4989-0.6566j, 0.3488+0.4453j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6800, 0.3200]], grad_fn=<PowBackward0>)
loss:  0.385620653629303
loss:  0.6362279057502747
loss:  0.28008604049682617
loss:  0.8641088008880615
----------index20----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6102-0.5873j, 0.3824+0.3696j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7172, 0.2828]], grad_fn=<PowBackward0>)
loss:  0.33242276310920715
loss:  0.33132821321487427
loss:  0.18313966691493988
loss:  0.3865702748298645
----------index24----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6027-0.3102j, 0.6435+0.3555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4595, 0.5405]], grad_fn=<PowBackward0>)
loss:  0.615284264087677
loss:  0.26973578333854675
loss:  0.48195555806159973
loss:  0.1369628757238388
----------index28----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6966-0.6217j, 0.2650+0.2407j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8718, 0.1282]], grad_fn=<PowBackward0>)
loss:  0.13717246055603027
loss:  0.2795180082321167
loss:  0.5493413805961609
loss:  0.3339811861515045
----------index32----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5328-0.5982j, 0.4009+0.4446j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6417, 0.3583]], grad_fn=<PowBackward0>)
loss:  0.4436987042427063
loss:  0.22550323605537415
loss:  0.18256458640098572
loss:  0.6113480925559998
----------index36----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5939-0.5715j, 0.4072+0.3935j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6793, 0.3207]], grad_fn=<PowBackward0>)
loss:  0.3867075741291046
loss:  0.5028811097145081
loss:  0.31995511054992676
loss:  0.18309056758880615
----------index40----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5218-0.5424j, 0.4574+0.4736j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5665, 0.4335]], grad_fn=<PowBackward0>)
loss:  0.5682728290557861
loss:  0.5643266439437866
loss:  0.42539912462234497
loss:  0.8379148244857788
----------index44----------
train inputs:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5635-0.6323j, 0.3563+0.3945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7174, 0.2826]], grad_fn=<PowBackward0>)
loss:  0.33213308453559875
loss:  0.27997374534606934
loss:  0.5473414063453674
loss:  0.3321254253387451
----------index48----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0528+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5635-0.3224j, 0.6502+0.3945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4215, 0.5785]], grad_fn=<PowBackward0>)
loss:  0.5473465323448181
loss:  0.13985534012317657
loss:  0.3323015868663788
loss:  0.0006984526989981532
----------index52----------
train inputs:  tensor([[1.2310, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0528+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5554-0.5772j, 0.4160+0.4306j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6416, 0.3584]], grad_fn=<PowBackward0>)
loss:  0.44386711716651917
loss:  0.5642896294593811
loss:  0.7696744203567505
loss:  0.370379775762558
----------index56----------
train inputs:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0528+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5600-0.4235j, 0.5620+0.4372j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4930, 0.5070]], grad_fn=<PowBackward0>)
loss:  0.6792721748352051
loss:  0.140358567237854
loss:  1.1541810035705566
loss:  0.0006984526989981532
----------index60----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.1925+0.j, 0.9813+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0264j],
        [0.0000+0.0264j, 0.9997+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1315-0.1028j, 0.7584+0.6300j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0279, 0.9721]], grad_fn=<PowBackward0>)
loss:  0.02827303484082222
loss:  1.4345474243164062
loss:  0.08705583214759827
loss:  0.10017338395118713
----------index64----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0529+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6179-0.6419j, 0.3157+0.3263j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7938, 0.2062]], grad_fn=<PowBackward0>)
loss:  0.23088154196739197
loss:  0.608744204044342
loss:  1.2939691543579102
loss:  0.38475942611694336
----------index68----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6947-0.4024j, 0.5077+0.3125j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6445, 0.3555]], grad_fn=<PowBackward0>)
loss:  1.034345030784607
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.44698867201805115
------------------------------Epoch14------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6707-0.5531j, 0.3777+0.3188j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7557, 0.2443]], grad_fn=<PowBackward0>)
loss:  0.2800702750682831
loss:  0.5684007406234741
loss:  0.14027969539165497
loss:  0.8641034364700317
----------index4----------
train inputs:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5635-0.6323j, 0.3563+0.3946j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7173, 0.2827]], grad_fn=<PowBackward0>)
loss:  0.33224958181381226
loss:  0.13721738755702972
loss:  0.18315735459327698
loss:  0.5644534230232239
----------index8----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8089-0.3278j, 0.4439+0.2030j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7617, 0.2383]], grad_fn=<PowBackward0>)
loss:  1.4343409538269043
loss:  0.44401076436042786
loss:  0.3313332796096802
loss:  0.3702448308467865
----------index12----------
train inputs:  tensor([[1.8331, 1.6078]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4070-0.4235j, 0.5620+0.5824j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3450, 0.6550]], grad_fn=<PowBackward0>)
loss:  0.42308104038238525
loss:  0.3856006860733032
loss:  0.5644391775131226
loss:  0.10014083236455917
----------index16----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5938-0.5715j, 0.4073+0.3936j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6792, 0.3208]], grad_fn=<PowBackward0>)
loss:  0.3867878019809723
loss:  0.3710870146751404
loss:  0.68376624584198
loss:  0.38477274775505066
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6667+0.j, 0.7454+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5635-0.3223j, 0.6503+0.3946j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4214, 0.5786]], grad_fn=<PowBackward0>)
loss:  0.547222375869751
loss:  1.2939231395721436
loss:  0.6112465858459473
loss:  0.13978911936283112
----------index24----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0530+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6102-0.5873j, 0.3824+0.3696j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7172, 0.2828]], grad_fn=<PowBackward0>)
loss:  0.33241575956344604
loss:  0.6086693406105042
loss:  0.13731995224952698
loss:  0.549246072769165
----------index28----------
train inputs:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5483-0.6154j, 0.3793+0.4204j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6794, 0.3206]], grad_fn=<PowBackward0>)
loss:  0.3866153657436371
loss:  0.08708775788545609
loss:  0.0007039401680231094
loss:  0.18249690532684326
----------index32----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4723-0.1481j, 0.8157+0.2995j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2450, 0.7550]], grad_fn=<PowBackward0>)
loss:  0.28102150559425354
loss:  0.048280976712703705
loss:  0.2800934612751007
loss:  0.23095129430294037
----------index36----------
train inputs:  tensor([[1.8331, 0.5513]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.5513+0.j]])
rz_matrix:  tensor([[0.9623-0.2722j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9623+0.2722j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5797-0.1453j, 0.7677+0.2314j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3571, 0.6429]], grad_fn=<PowBackward0>)
loss:  0.44181978702545166
loss:  1.1539045572280884
loss:  0.4438270032405853
loss:  0.8376740217208862
----------index40----------
train inputs:  tensor([[1.0685, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6323-0.5635j, 0.3946+0.3564j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7173, 0.2827]], grad_fn=<PowBackward0>)
loss:  0.3322713375091553
loss:  0.6362512707710266
loss:  0.2796075642108917
loss:  1.0342562198638916
----------index44----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6179-0.6418j, 0.3157+0.3264j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7938, 0.2062]], grad_fn=<PowBackward0>)
loss:  0.2309567779302597
loss:  0.425251841545105
loss:  0.048526402562856674
loss:  0.503026008605957
----------index48----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6383+0.j, 0.7698+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4939-0.3721j, 0.6209+0.4818j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3824, 0.6176]], grad_fn=<PowBackward0>)
loss:  0.4818442761898041
loss:  0.4375244379043579
loss:  0.7694743871688843
loss:  0.10011962056159973
----------index52----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0265j],
        [0.0000+0.0265j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6650-0.3047j, 0.6101+0.3046j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5350, 0.4650]], grad_fn=<PowBackward0>)
loss:  0.765699028968811
loss:  0.3848261535167694
loss:  0.6790086627006531
loss:  1.3486186265945435
----------index56----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.1925+0.j, 0.9813+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1315-0.1027j, 0.7584+0.6301j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0278, 0.9722]], grad_fn=<PowBackward0>)
loss:  0.02823312021791935
loss:  0.22540271282196045
loss:  0.000705490936525166
loss:  0.33391276001930237
----------index60----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5873-0.6101j, 0.3696+0.3824j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7171, 0.2829]], grad_fn=<PowBackward0>)
loss:  0.33247727155685425
loss:  0.6151565909385681
loss:  0.1370382010936737
loss:  0.6801720857620239
----------index64----------
train inputs:  tensor([[2.0731, 1.5338]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5092+0.j, 0.8607+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.5092+0.j, 0.8607+0.j]])
New state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0531+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3507-0.3367j, 0.6289+0.6067j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2363, 0.7637]], grad_fn=<PowBackward0>)
loss:  0.2696264386177063
loss:  0.5471165180206299
loss:  0.18320882320404053
loss:  0.37206313014030457
----------index68----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4314-0.2959j, 0.6930+0.4960j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2737, 0.7263]], grad_fn=<PowBackward0>)
loss:  0.31979385018348694
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.44700106978416443
------------------------------Epoch15------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5715-0.3615j, 0.6139+0.4073j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4572, 0.5428]], grad_fn=<PowBackward0>)
loss:  0.6111049056053162
loss:  0.43758705258369446
loss:  0.5470886826515198
loss:  0.33389046788215637
----------index4----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8165+0.j, 0.5774+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5327-0.5981j, 0.4009+0.4447j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6415, 0.3585]], grad_fn=<PowBackward0>)
loss:  0.4439137578010559
loss:  0.3848920166492462
loss:  0.1372741311788559
loss:  0.1370614469051361
----------index8----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2405-0.1934j, 0.7312+0.6084j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0952, 0.9048]], grad_fn=<PowBackward0>)
loss:  0.10008450597524643
loss:  0.5031123757362366
loss:  0.549138605594635
loss:  0.18322500586509705
----------index12----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[1.+0.j, 0.+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7932-0.6084j, 0.0162+0.0211j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9929e-01, 7.0739e-04]], grad_fn=<PowBackward0>)
loss:  0.0007076382171362638
loss:  0.5685393810272217
loss:  0.3323418200016022
loss:  0.33143165707588196
----------index16----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.4989-0.6566j, 0.3489+0.4453j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6800, 0.3200]], grad_fn=<PowBackward0>)
loss:  0.3857116401195526
loss:  1.3486140966415405
loss:  0.44412562251091003
loss:  0.22536642849445343
----------index20----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4447-0.3340j, 0.6570+0.5089j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3094, 0.6906]], grad_fn=<PowBackward0>)
loss:  0.37014299631118774
loss:  0.18244676291942596
loss:  0.3720529079437256
loss:  0.769398033618927
----------index24----------
train inputs:  tensor([[0.5513, 0.6797]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.5513]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.5513+0.j]])
ry_matrix:  tensor([[ 0.9623-0.j, -0.2722-0.j],
        [ 0.2722+0.j,  0.9623-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9623+0.j, 0.2722+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.9623+0.j, 0.2722+0.j]])
New state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9045-0.3138j, 0.2650+0.1148j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9166, 0.0834]], grad_fn=<PowBackward0>)
loss:  0.08711416274309158
loss:  0.765618085861206
loss:  0.5470906496047974
loss:  0.4251801669597626
----------index28----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.5338+0.j]])
rz_matrix:  tensor([[0.7201-0.6939j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7201+0.6939j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5938-0.5715j, 0.4073+0.3936j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6792, 0.3208]], grad_fn=<PowBackward0>)
loss:  0.38690662384033203
loss:  0.42296102643013
loss:  0.2801612913608551
loss:  0.2796676456928253
----------index32----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6179-0.6418j, 0.3158+0.3264j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7937, 0.2063]], grad_fn=<PowBackward0>)
loss:  0.23101340234279633
loss:  0.48176109790802
loss:  0.2801625728607178
loss:  0.04855030030012131
----------index36----------
train inputs:  tensor([[2.3514, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.3514]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.3514+0.j]])
ry_matrix:  tensor([[ 0.3849-0.j, -0.9230-0.j],
        [ 0.9230+0.j,  0.3849-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3849+0.j, 0.9230+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.3849+0.j, 0.9230+0.j]])
New state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3000-0.2021j, 0.7592+0.5410j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1308, 0.8692]], grad_fn=<PowBackward0>)
loss:  0.14022421836853027
loss:  0.5645758509635925
loss:  0.837544858455658
loss:  0.3325204849243164
----------index40----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5387-0.4069j, 0.5824+0.4527j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4558, 0.5442]], grad_fn=<PowBackward0>)
loss:  0.6085259914398193
loss:  0.10008464008569717
loss:  0.6151048541069031
loss:  0.38671573996543884
----------index44----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6179-0.6418j, 0.3158+0.3264j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7937, 0.2063]], grad_fn=<PowBackward0>)
loss:  0.23101572692394257
loss:  0.33234405517578125
loss:  0.13738086819648743
loss:  0.2695963680744171
----------index48----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8066-0.2740j, 0.4875+0.1912j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7258, 0.2742]], grad_fn=<PowBackward0>)
loss:  1.2937260866165161
loss:  0.6801155209541321
loss:  0.28097406029701233
loss:  0.6789068579673767
----------index52----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8089-0.3278j, 0.4440+0.2030j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7617, 0.2383]], grad_fn=<PowBackward0>)
loss:  1.4341224431991577
loss:  0.8642679452896118
loss:  0.38490140438079834
loss:  1.034103512763977
----------index56----------
train inputs:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5872-0.6101j, 0.3697+0.3824j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7171, 0.2829]], grad_fn=<PowBackward0>)
loss:  0.3325311243534088
loss:  0.13971741497516632
loss:  1.1537392139434814
loss:  0.37095752358436584
----------index60----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5443+0.j, 0.8389+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4314-0.2959j, 0.6931+0.4960j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2737, 0.7263]], grad_fn=<PowBackward0>)
loss:  0.3197678327560425
loss:  0.5645976662635803
loss:  0.1832374483346939
loss:  0.4417611062526703
----------index64----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7980-0.5622j, 0.1722+0.1324j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9528, 0.0472]], grad_fn=<PowBackward0>)
loss:  0.04831475391983986
loss:  0.6835764050483704
loss:  0.6363868713378906
loss:  0.0007085925899446011
----------index68----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.1925+0.j, 0.9813+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1314-0.1027j, 0.7584+0.6301j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0278, 0.9722]], grad_fn=<PowBackward0>)
loss:  0.028212090954184532
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.4470049738883972
--------------------Test--------------------
test input:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5635-0.6322j, 0.3564+0.3947j]])
----------Measure----------
Probability:  tensor([[0.7172, 0.2828]])
test input:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5714-0.3615j, 0.6139+0.4073j]])
----------Measure----------
Probability:  tensor([[0.4572, 0.5428]])
test input:  tensor([[0.3873, 1.4595]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9813+0.j, 0.1925+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
New state:  tensor([[0.7277-0.6502j, 0.1608+0.1477j]])
----------Measure----------
Probability:  tensor([[0.9523, 0.0477]])
test input:  tensor([[1.4595, 2.2519]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[2.2519]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.2519+0.j]])
rz_matrix:  tensor([[0.4303-0.9027j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.4303+0.9027j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
New state:  tensor([[0.3046-0.6649j, 0.3047+0.6101j]])
----------Measure----------
Probability:  tensor([[0.5349, 0.4651]])
test input:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5872-0.6101j, 0.3697+0.3824j]])
----------Measure----------
Probability:  tensor([[0.7171, 0.2829]])
test input:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.7902+0.j]])
rz_matrix:  tensor([[0.9230-0.3849j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9230+0.3849j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6809-0.2704j, 0.6227+0.2748j]])
----------Measure----------
Probability:  tensor([[0.5367, 0.4633]])
test input:  tensor([[1.6078, 1.9106]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
New state:  tensor([[0.3848-0.5553j, 0.4307+0.5984j]])
----------Measure----------
Probability:  tensor([[0.4564, 0.5436]])
test input:  tensor([[1.6078, 2.4619]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.4619+0.j]])
rz_matrix:  tensor([[0.3333-0.9428j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.3333+0.9428j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
New state:  tensor([[0.2131-0.6476j, 0.2574+0.6848j]])
----------Measure----------
Probability:  tensor([[0.4648, 0.5352]])
test input:  tensor([[1.4595, 0.6797]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.6797+0.j]])
rz_matrix:  tensor([[0.9428-0.3333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9428+0.3333j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
New state:  tensor([[0.6966-0.2316j, 0.6349+0.2408j]])
----------Measure----------
Probability:  tensor([[0.5389, 0.4611]])
test input:  tensor([[2.4619, 1.3085]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.3333+0.j, 0.9428+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
New state:  tensor([[0.2491-0.1829j, 0.7532+0.5806j]])
----------Measure----------
Probability:  tensor([[0.0955, 0.9045]])
test input:  tensor([[1.8331, 1.0685]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6086+0.j, 0.7935+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.0685+0.j]])
rz_matrix:  tensor([[0.8607-0.5092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8607+0.5092j]])
Performing matrix multiplication

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
New state:  tensor([[0.5128-0.2916j, 0.6909+0.4178j]])
----------Measure----------
Probability:  tensor([[0.3480, 0.6520]])
test input:  tensor([[0.8897, 1.3085]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7090-0.5401j, 0.3560+0.2809j]])
----------Measure----------
Probability:  tensor([[0.7944, 0.2056]])
test input:  tensor([[1.7571, 1.4595]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6383+0.j, 0.7698+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.4595+0.j]])
rz_matrix:  tensor([[0.7454-0.6667j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6667j]])
Performing matrix multiplication

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
New state:  tensor([[0.4619-0.4101j, 0.5849+0.5257j]])
----------Measure----------
Probability:  tensor([[0.3816, 0.6184]])
test input:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.5774+0.j, 0.8165+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4723-0.2959j, 0.6931+0.4572j]])
----------Measure----------
Probability:  tensor([[0.3107, 0.6893]])
test input:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5599-0.4234j, 0.5621+0.4373j]])
----------Measure----------
Probability:  tensor([[0.4928, 0.5072]])
test input:  tensor([[1.6078, 1.2310]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.6939+0.j, 0.7201+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.2310+0.j]])
rz_matrix:  tensor([[0.8165-0.5774j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8165+0.5774j]])
Performing matrix multiplication

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
New state:  tensor([[0.5553-0.3848j, 0.5984+0.4307j]])
----------Measure----------
Probability:  tensor([[0.4564, 0.5436]])
test input:  tensor([[1.3845, 1.8331]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.8331+0.j]])
rz_matrix:  tensor([[0.6086-0.7935j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6086+0.7935j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
New state:  tensor([[0.4548-0.6003j, 0.4046+0.5188j]])
----------Measure----------
Probability:  tensor([[0.5672, 0.4328]])
test input:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7698+0.j, 0.6383+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5217-0.5423j, 0.4575+0.4737j]])
----------Measure----------
Probability:  tensor([[0.5663, 0.4337]])
test input:  tensor([[1.5338, 0.8897]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7201+0.j, 0.6939+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.8897+0.j]])
rz_matrix:  tensor([[0.9027-0.4303j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.9027+0.4303j]])
Performing matrix multiplication

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
New state:  tensor([[0.6418-0.2931j, 0.6344+0.3158j]])
----------Measure----------
Probability:  tensor([[0.4978, 0.5022]])
test input:  tensor([[2.5903, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.5903]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.5903+0.j]])
ry_matrix:  tensor([[ 0.2722-0.j, -0.9623-0.j],
        [ 0.9623+0.j,  0.2722-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.2722+0.j, 0.9623+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.1512+0.j]])
rz_matrix:  tensor([[0.8389-0.5443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8389+0.5443j]])
Performing matrix multiplication

Current state:  tensor([[0.2722+0.j, 0.9623+0.j]])
New state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
New state:  tensor([[0.2143-0.1266j, 0.8109+0.5297j]])
----------Measure----------
Probability:  tensor([[0.0620, 0.9380]])
test input:  tensor([[0.8897, 1.3085]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3085+0.j]])
rz_matrix:  tensor([[0.7935-0.6086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7935+0.6086j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7090-0.5401j, 0.3560+0.2809j]])
----------Measure----------
Probability:  tensor([[0.7944, 0.2056]])
test input:  tensor([[1.1512, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6078+0.j]])
rz_matrix:  tensor([[0.6939-0.7201j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6939+0.7201j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
New state:  tensor([[0.5714-0.5938j, 0.3936+0.4073j]])
----------Measure----------
Probability:  tensor([[0.6791, 0.3209]])
test input:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8819+0.j, 0.4714+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6707-0.5531j, 0.3777+0.3189j]])
----------Measure----------
Probability:  tensor([[0.7556, 0.2444]])
test input:  tensor([[1.0685, 1.7571]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8607+0.j, 0.5092+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.7571+0.j]])
rz_matrix:  tensor([[0.6383-0.7698j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6383+0.7698j]])
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
New state:  tensor([[0.5387-0.6537j, 0.3425+0.4064j]])
----------Measure----------
Probability:  tensor([[0.7175, 0.2825]])
test input:  tensor([[1.4595, 0.9818]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.7454+0.j, 0.6667+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[0.9818+0.j]])
rz_matrix:  tensor([[0.8819-0.4714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.8819+0.4714j]])
Performing matrix multiplication

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
New state:  tensor([[0.6487-0.3356j, 0.5971+0.3317j]])
----------Measure----------
Probability:  tensor([[0.5335, 0.4665]])
test input:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.9106+0.j]])
rz_matrix:  tensor([[0.5774-0.8165j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5774+0.8165j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4723-0.6763j, 0.3324+0.4572j]])
----------Measure----------
Probability:  tensor([[0.6805, 0.3195]])
test input:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.8389+0.j, 0.5443+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.6821+0.j]])
rz_matrix:  tensor([[0.6667-0.7454j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6667+0.7454j]])
Performing matrix multiplication

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5483-0.6154j, 0.3794+0.4205j]])
----------Measure----------
Probability:  tensor([[0.6793, 0.3207]])
test input:  tensor([[0.6797, 1.7571]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9428+0.j, 0.3333+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.7571+0.j]])
rz_matrix:  tensor([[0.6383-0.7698j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6383+0.7698j]])
Performing matrix multiplication

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
New state:  tensor([[0.5947-0.7199j, 0.2320+0.2725j]])
----------Measure----------
Probability:  tensor([[0.8719, 0.1281]])
test input:  tensor([[0.8897, 1.3845]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

Current state:  tensor([[1.+0.j, 0.+0.j]])
New state:  tensor([[0.9027+0.j, 0.4303+0.j]])
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  rz
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[1.3845+0.j]])
rz_matrix:  tensor([[0.7698-0.6383j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7698+0.6383j]])
Performing matrix multiplication

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0532+0.j]])
rx_matrix:  tensor([[0.9996+0.0000j, 0.0000+0.0266j],
        [0.0000+0.0266j, 0.9996+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
New state:  tensor([[0.6873-0.5671j, 0.3465+0.2931j]])
----------Measure----------
Probability:  tensor([[0.7941, 0.2059]])
test set accuracy: 0.8275862336158752
test set loss: 0.4470050036907196
