------------------------------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.4262617826461792
loss:  0.42612531781196594
loss:  0.5004552602767944
----------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.38605251908302307
loss:  0.31737416982650757
loss:  0.04329562559723854
loss:  0.31744614243507385
----------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.6137473583221436
loss:  0.5656107664108276
loss:  0.26659858226776123
loss:  0.2665484845638275
----------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.12803985178470612
loss:  0.3343789875507355
loss:  0.3699471056461334
loss:  0.34202444553375244
----------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.0280+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.12771695852279663
loss:  0.368699312210083
loss:  0.03259709104895592
loss:  0.7891957759857178
----------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.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.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.4418001174926758
loss:  0.10841424018144608
loss:  0.00019063382933381945
loss:  0.2182001769542694
----------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.3694920539855957
loss:  1.0648151636123657
loss:  0.44292595982551575
loss:  0.5445125699043274
----------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.6957-0.5315j, 0.3815+0.2966j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7665, 0.2335]], grad_fn=<PowBackward0>)
loss:  0.265871524810791
loss:  0.3161897659301758
loss:  0.632754385471344
loss:  0.8661530017852783
----------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.19293487071990967
loss:  0.14934466779232025
loss:  0.6310831904411316
loss:  0.23736043274402618
----------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.5470943450927734
loss:  0.28970056772232056
loss:  0.3872586190700531
loss:  0.7050370573997498
----------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.36985427141189575
loss:  1.1818324327468872
loss:  0.8400481343269348
loss:  1.3187172412872314
----------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.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.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.148935467004776
loss:  0.5658879280090332
loss:  1.349507451057434
loss:  0.6328423619270325
----------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.0152j],
        [0.0000+0.0152j, 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.3183501064777374
loss:  0.10738862305879593
loss:  0.7004243731498718
loss:  0.42402639985084534
----------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.0312+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.45025262236595154
loss:  0.2818617522716522
loss:  0.08282774686813354
loss:  0.12923432886600494
----------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.4099j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5035, 0.4965]], grad_fn=<PowBackward0>)
loss:  0.7001355886459351
loss:  0.1739417314529419
loss:  0.5629024505615234
loss:  1.4613107442855835
----------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.0326+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.0129j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9973e-01, 2.6618e-04]], grad_fn=<PowBackward0>)
loss:  0.00026622979203239083
loss:  0.4873693585395813
loss:  0.17433802783489227
loss:  0.3720109760761261
----------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.0331+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.7824900150299072
loss:  0.5488241314888
loss:  0.2209874987602234
loss:  0.04432825371623039
----------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.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.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.3201368749141693
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.4455220103263855
------------------------------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.8598993420600891
loss:  0.4376032054424286
loss:  0.2879846692085266
loss:  0.2210347205400467
----------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.0334+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.5514096021652222
loss:  0.1298978328704834
loss:  0.49697446823120117
loss:  0.3402799367904663
----------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.0334+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.4290j, 0.5578+0.4318j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5024, 0.4976]], grad_fn=<PowBackward0>)
loss:  0.697934091091156
loss:  0.4255021810531616
loss:  0.03156450390815735
loss:  0.14744725823402405
----------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.0337+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 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.4296950697898865
loss:  0.2693784236907959
loss:  1.1764951944351196
loss:  0.3828282654285431
----------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.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.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.3189, 0.6811]], grad_fn=<PowBackward0>)
loss:  0.38399413228034973
loss:  0.4384802281856537
loss:  0.6980264782905579
loss:  0.08335573971271515
----------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.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+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.6135, 0.3865]], grad_fn=<PowBackward0>)
loss:  0.48864108324050903
loss:  0.13028429448604584
loss:  0.561019241809845
loss:  0.7835896611213684
----------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.0350+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0175j],
        [0.0000+0.0175j, 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.1631+0.1307j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9563, 0.0437]], grad_fn=<PowBackward0>)
loss:  0.04467853903770447
loss:  1.4577698707580566
loss:  0.6289275288581848
loss:  1.0552399158477783
----------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.0358+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0179j],
        [0.0000+0.0179j, 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.3102+0.3210j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8007, 0.1993]], grad_fn=<PowBackward0>)
loss:  0.22224487364292145
loss:  0.37386980652809143
loss:  0.32120826840400696
loss:  0.10554102808237076
----------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.0364+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.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4762-0.6791j, 0.3267+0.4532j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6879, 0.3121]], grad_fn=<PowBackward0>)
loss:  0.3741118907928467
loss:  0.6982399821281433
loss:  0.18925140798091888
loss:  1.3493012189865112
----------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.0368+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0184j],
        [0.0000+0.0184j, 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.5970-0.5748j, 0.4026+0.3888j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6868, 0.3132]], grad_fn=<PowBackward0>)
loss:  0.3757661283016205
loss:  0.3756738603115082
loss:  0.3292680084705353
loss:  0.3224179148674011
----------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.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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8082-0.2780j, 0.4853+0.1847j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7304, 0.2696]], grad_fn=<PowBackward0>)
loss:  1.310807704925537
loss:  0.2712051570415497
loss:  0.4479861855506897
loss:  0.14578726887702942
----------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.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.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5424-0.4116j, 0.5791+0.4484j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4636, 0.5364]], grad_fn=<PowBackward0>)
loss:  0.6227846145629883
loss:  0.6245004534721375
loss:  0.13120006024837494
loss:  0.43242618441581726
----------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.0377+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.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5023-0.6593j, 0.3437+0.4415j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6869, 0.3131]], grad_fn=<PowBackward0>)
loss:  0.3754979074001312
loss:  0.00035524717532098293
loss:  0.17638806998729706
loss:  0.17638075351715088
----------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.0376+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.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4089-0.6391j, 0.3595+0.5432j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5756, 0.4244]], grad_fn=<PowBackward0>)
loss:  0.5522757768630981
loss:  0.3226606845855713
loss:  0.3227093815803528
loss:  0.5519866943359375
----------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.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.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3754-0.2588j, 0.7250+0.5162j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2079, 0.7921]], grad_fn=<PowBackward0>)
loss:  0.23304158449172974
loss:  0.5593051910400391
loss:  0.0003400426940061152
loss:  0.2787976562976837
----------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.0368+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0184j],
        [0.0000+0.0184j, 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.2455-0.1994j, 0.7296+0.6064j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1000, 0.9000]], grad_fn=<PowBackward0>)
loss:  0.10537895560264587
loss:  0.3221888542175293
loss:  0.779438316822052
loss:  0.8475249409675598
----------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.0367+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0184j],
        [0.0000+0.0184j, 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.7991-0.5636j, 0.1675+0.1258j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9561, 0.0439]], grad_fn=<PowBackward0>)
loss:  0.0448768213391304
loss:  0.6209751963615417
loss:  0.38156306743621826
loss:  0.2705666124820709
----------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.0364+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.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5815-0.3023j, 0.6630+0.3620j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4294, 0.5706]], grad_fn=<PowBackward0>)
loss:  0.5611504316329956
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.44573891162872314
------------------------------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.0364+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.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9054-0.3160j, 0.2624+0.1072j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9197, 0.0803]], grad_fn=<PowBackward0>)
loss:  0.08375094830989838
loss:  0.6959478855133057
loss:  0.3219202160835266
loss:  0.37542787194252014
----------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.0363+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0181j],
        [0.0000+0.0181j, 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.7529-0.3520j, 0.4978+0.2479j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6907, 0.3093]], grad_fn=<PowBackward0>)
loss:  1.1734555959701538
loss:  0.7824323773384094
loss:  0.32204893231391907
loss:  0.1055111512541771
----------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.0364+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.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8105-0.3315j, 0.4412+0.1962j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7668, 0.2332]], grad_fn=<PowBackward0>)
loss:  1.4560260772705078
loss:  0.6233799457550049
loss:  0.3215028643608093
loss:  0.7794087529182434
----------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.0369+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.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4091-0.6392j, 0.3593+0.5431j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5760, 0.4240]], grad_fn=<PowBackward0>)
loss:  0.5517051815986633
loss:  1.349291443824768
loss:  0.37579426169395447
loss:  0.6976804137229919
----------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.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.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6985-0.6238j, 0.2601+0.2352j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8770, 0.1230]], grad_fn=<PowBackward0>)
loss:  0.1312355399131775
loss:  0.4362066984176636
loss:  0.3746873736381531
loss:  0.04500556364655495
----------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.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.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6055-0.3152j, 0.6411+0.3508j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4660, 0.5340]], grad_fn=<PowBackward0>)
loss:  0.6273095011711121
loss:  0.6940389275550842
loss:  0.42796313762664795
loss:  0.22315075993537903
----------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.0376+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.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4737-0.6225j, 0.3822+0.4919j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6120, 0.3880]], grad_fn=<PowBackward0>)
loss:  0.49104970693588257
loss:  0.14594705402851105
loss:  0.2715361416339874
loss:  0.27117568254470825
----------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.0376+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.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4115-0.4278j, 0.5587+0.5792j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3523, 0.6477]], grad_fn=<PowBackward0>)
loss:  0.4343918561935425
loss:  1.0527912378311157
loss:  0.5588001608848572
loss:  0.38157957792282104
----------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.0378+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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8081-0.2778j, 0.4854+0.1850j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7301, 0.2699]], grad_fn=<PowBackward0>)
loss:  1.3098766803741455
loss:  0.44761550426483154
loss:  0.37583956122398376
loss:  0.8541193008422852
----------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.0385+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0192j],
        [0.0000+0.0192j, 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.4086-0.6390j, 0.3598+0.5434j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5753, 0.4247]], grad_fn=<PowBackward0>)
loss:  0.5529471635818481
loss:  0.4929148256778717
loss:  0.10473363101482391
loss:  0.1451038420200348
----------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.0391+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.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5899-0.6127j, 0.3653+0.3782j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7235, 0.2765]], grad_fn=<PowBackward0>)
loss:  0.323720782995224
loss:  0.13205741345882416
loss:  0.28586578369140625
loss:  0.045591749250888824
----------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.0394+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0197j],
        [0.0000+0.0197j, 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.0131+0.0147j,  0.7452+0.6665j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[3.8810e-04, 9.9961e-01]], grad_fn=<PowBackward0>)
loss:  0.0003881611628457904
loss:  0.5574039220809937
loss:  0.1880199909210205
loss:  0.22417902946472168
----------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.0397+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0199j],
        [0.0000+0.0199j, 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.3747-0.2578j, 0.7253+0.5167j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2069, 0.7931]], grad_fn=<PowBackward0>)
loss:  0.23176643252372742
loss:  0.3275514543056488
loss:  0.1321108192205429
loss:  0.03043883852660656
----------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.0401+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.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6346-0.5660j, 0.3909+0.3522j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7231, 0.2769]], grad_fn=<PowBackward0>)
loss:  0.32423701882362366
loss:  0.37861067056655884
loss:  0.6220198273658752
loss:  0.273030549287796
----------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.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.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5807-0.3009j, 0.6636+0.3632j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4278, 0.5722]], grad_fn=<PowBackward0>)
loss:  0.5582510828971863
loss:  0.6245585083961487
loss:  0.17764461040496826
loss:  0.3379349410533905
----------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.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.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3544-0.3407j, 0.6268+0.6045j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2417, 0.7583]], grad_fn=<PowBackward0>)
loss:  0.2766406536102295
loss:  0.43483906984329224
loss:  0.5576732158660889
loss:  0.8514643311500549
----------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.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.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5355-0.6007j, 0.3972+0.4413j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6475, 0.3525]], grad_fn=<PowBackward0>)
loss:  0.4345848858356476
loss:  0.1775796115398407
loss:  0.37658846378326416
loss:  0.0004025315574835986
----------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.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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4619-0.3199j, 0.6732+0.4807j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3157, 0.6843]], grad_fn=<PowBackward0>)
loss:  0.379366010427475
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4459870457649231
------------------------------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.0399+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0199j],
        [0.0000+0.0199j, 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.6967-0.4058j, 0.5051+0.3079j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6501, 0.3499]], grad_fn=<PowBackward0>)
loss:  1.050001621246338
loss:  0.6239358186721802
loss:  0.3762795329093933
loss:  0.6953750252723694
----------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.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.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6493-0.6742j, 0.2447+0.2530j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8761, 0.1239]], grad_fn=<PowBackward0>)
loss:  0.13225150108337402
loss:  0.2771925926208496
loss:  0.1772289276123047
loss:  0.44700542092323303
----------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.0396+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.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3037-0.2073j, 0.7578+0.5390j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1352, 0.8648]], grad_fn=<PowBackward0>)
loss:  0.1452220231294632
loss:  0.08438532799482346
loss:  0.2241371124982834
loss:  0.5566928386688232
----------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.0395+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0197j],
        [0.0000+0.0197j, 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.6051-0.3145j, 0.6414+0.3515j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4651, 0.5349]], grad_fn=<PowBackward0>)
loss:  0.625662088394165
loss:  0.32776421308517456
loss:  0.8502721786499023
loss:  0.1880701333284378
----------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.0394+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0197j],
        [0.0000+0.0197j, 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.6670-0.3088j, 0.6080+0.3001j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5403, 0.4597]], grad_fn=<PowBackward0>)
loss:  0.7771781086921692
loss:  0.5536891222000122
loss:  0.433013916015625
loss:  0.030539248138666153
----------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.0395+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0197j],
        [0.0000+0.0197j, 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.4878-0.3385j, 0.6547+0.4678j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3525, 0.6475]], grad_fn=<PowBackward0>)
loss:  0.4346392750740051
loss:  1.3080936670303345
loss:  0.3239421844482422
loss:  0.8525721430778503
----------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.0398+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0199j],
        [0.0000+0.0199j, 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.7762-0.5940j, 0.1646+0.1326j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9553, 0.0447]], grad_fn=<PowBackward0>)
loss:  0.04569219425320625
loss:  0.2727828621864319
loss:  0.5570281744003296
loss:  0.000400921591790393
----------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.0401+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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6939-0.5291j, 0.3847+0.3009j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7614, 0.2386]], grad_fn=<PowBackward0>)
loss:  0.2725312411785126
loss:  0.13218897581100464
loss:  0.37859734892845154
loss:  0.3243055045604706
----------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.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.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5808-0.3010j, 0.6635+0.3631j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4279, 0.5721]], grad_fn=<PowBackward0>)
loss:  0.5583810806274414
loss:  0.10423412173986435
loss:  0.2854751646518707
loss:  0.378195583820343
----------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.0405+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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4618-0.3198j, 0.6733+0.4808j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3155, 0.6845]], grad_fn=<PowBackward0>)
loss:  0.37905892729759216
loss:  0.3246139585971832
loss:  0.5545474290847778
loss:  0.6919905543327332
----------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.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.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5355-0.6007j, 0.3972+0.4413j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6475, 0.3525]], grad_fn=<PowBackward0>)
loss:  0.4345764219760895
loss:  0.6217637062072754
loss:  0.13250236213207245
loss:  0.33793768286705017
----------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.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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2443-0.1980j, 0.7299+0.6069j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0989, 0.9011]], grad_fn=<PowBackward0>)
loss:  0.10413191467523575
loss:  0.3768182396888733
loss:  0.23132914304733276
loss:  0.37746119499206543
----------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.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.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5627-0.4269j, 0.5594+0.4338j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4989, 0.5011]], grad_fn=<PowBackward0>)
loss:  0.6909116506576538
loss:  0.32391127943992615
loss:  0.49341824650764465
loss:  0.7790282368659973
----------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.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.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8605+0.0104j, 0.5091+0.0175j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7405, 0.2595]], grad_fn=<PowBackward0>)
loss:  1.3491584062576294
loss:  0.14442045986652374
loss:  0.3782583773136139
loss:  0.045699432492256165
----------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.0407+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.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7933-0.6085j, 0.0124+0.0162j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9959e-01, 4.1432e-04]], grad_fn=<PowBackward0>)
loss:  0.0004143977421335876
loss:  0.5564708113670349
loss:  0.4299021065235138
loss:  0.37972545623779297
----------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.0407+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.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8101-0.3305j, 0.4419+0.1980j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7655, 0.2345]], grad_fn=<PowBackward0>)
loss:  1.4503846168518066
loss:  0.17774698138237
loss:  0.22477826476097107
loss:  0.4349903464317322
----------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.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.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7523-0.3509j, 0.4986+0.2497j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6890, 0.3110]], grad_fn=<PowBackward0>)
loss:  1.168083667755127
loss:  0.4911426305770874
loss:  0.3249110281467438
loss:  0.6193432807922363
----------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.0411+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.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6726-0.5553j, 0.3744+0.3148j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7608, 0.2392]], grad_fn=<PowBackward0>)
loss:  0.27344682812690735
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4460790753364563
------------------------------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.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.5577309131622314
loss:  0.4352264702320099
loss:  0.14461103081703186
loss:  0.852085292339325
----------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.0413+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.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4344-0.3001j, 0.6913+0.4934j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2787, 0.7213]], grad_fn=<PowBackward0>)
loss:  0.32671624422073364
loss:  0.5551308393478394
loss:  0.7785853147506714
loss:  0.6211380362510681
----------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.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.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4750-0.3001j, 0.6913+0.4544j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3157, 0.6843]], grad_fn=<PowBackward0>)
loss:  0.3793460428714752
loss:  0.6253453493118286
loss:  0.3784502446651459
loss:  0.10385818034410477
----------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.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.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2937-0.2190j, 0.7371+0.5679j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1342, 0.8658]], grad_fn=<PowBackward0>)
loss:  0.14411914348602295
loss:  0.23089280724525452
loss:  0.43537506461143494
loss:  0.37904298305511475
----------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.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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8077-0.2768j, 0.4859+0.1866j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7291, 0.2709]], grad_fn=<PowBackward0>)
loss:  1.3058347702026367
loss:  0.3252280056476593
loss:  0.3253794312477112
loss:  0.17815567553043365
----------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.0417+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.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5507-0.6176j, 0.3759+0.4173j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6846, 0.3154]], grad_fn=<PowBackward0>)
loss:  0.3789229094982147
loss:  0.0004343141335994005
loss:  0.046076223254203796
loss:  0.4462319016456604
----------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.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.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9051-0.3153j, 0.2632+0.1096j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9187, 0.0813]], grad_fn=<PowBackward0>)
loss:  0.0847768560051918
loss:  0.3773876428604126
loss:  0.2761525809764862
loss:  0.43151938915252686
----------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.0415+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.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4477-0.3379j, 0.6550+0.5063j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3146, 0.6854]], grad_fn=<PowBackward0>)
loss:  0.3777559697628021
loss:  0.4332391917705536
loss:  0.28505364060401917
loss:  0.2733376920223236
----------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.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.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6965-0.4053j, 0.5055+0.3085j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6493, 0.3507]], grad_fn=<PowBackward0>)
loss:  1.0478888750076294
loss:  0.32521891593933105
loss:  0.32453709840774536
loss:  0.555655837059021
----------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.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.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4727-0.6217j, 0.3835+0.4929j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6100, 0.3900]], grad_fn=<PowBackward0>)
loss:  0.4942675828933716
loss:  0.6186286807060242
loss:  0.37824273109436035
loss:  0.6907018423080444
----------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.0419+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0210j],
        [0.0000+0.0210j, 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.3506-0.2183j, 0.7620+0.4988j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1706, 0.8294]], grad_fn=<PowBackward0>)
loss:  0.18704086542129517
loss:  0.2739342749118805
loss:  0.13304656744003296
loss:  0.22536739706993103
----------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.0420+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0210j],
        [0.0000+0.0210j, 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.6122-0.3540j, 0.6048+0.3663j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5001, 0.4999]], grad_fn=<PowBackward0>)
loss:  0.6933473348617554
loss:  0.17829501628875732
loss:  0.4307299554347992
loss:  0.6895812153816223
----------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.0421+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0210j],
        [0.0000+0.0210j, 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.7987-0.5631j, 0.1690+0.1279j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9551, 0.0449]], grad_fn=<PowBackward0>)
loss:  0.045977361500263214
loss:  0.555419921875
loss:  0.8498584628105164
loss:  0.030066663399338722
----------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.0423+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.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5243-0.5448j, 0.4545+0.4708j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5718, 0.4282]], grad_fn=<PowBackward0>)
loss:  0.5590420961380005
loss:  0.32572996616363525
loss:  0.2741174101829529
loss:  1.448318362236023
----------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.0423+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.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4076-0.6383j, 0.3610+0.5442j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5735, 0.4265]], grad_fn=<PowBackward0>)
loss:  0.5559757351875305
loss:  0.4900396466255188
loss:  0.00044916223851032555
loss:  0.13327644765377045
----------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.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.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5188-0.1310j, 0.8102+0.2394j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2863, 0.7137]], grad_fn=<PowBackward0>)
loss:  0.33734259009361267
loss:  0.22557269036769867
loss:  0.10353539139032364
loss:  0.3779780864715576
----------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.0425+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.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8605+0.0108j, 0.5091+0.0183j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7405, 0.2595]], grad_fn=<PowBackward0>)
loss:  1.3490906953811646
loss:  0.1330339014530182
loss:  1.1662817001342773
loss:  0.6233795881271362
----------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.0425+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.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6666-0.3079j, 0.6085+0.3011j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5391, 0.4609]], grad_fn=<PowBackward0>)
loss:  0.7745883464813232
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.446182519197464
------------------------------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.0426+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.5065j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3141, 0.6859]], grad_fn=<PowBackward0>)
loss:  0.3770376443862915
loss:  0.1867542415857315
loss:  0.37813031673431396
loss:  0.04611542075872421
----------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.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.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3739-0.2567j, 0.7257+0.5173j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2057, 0.7943]], grad_fn=<PowBackward0>)
loss:  0.23031143844127655
loss:  0.5563498735427856
loss:  0.7773637771606445
loss:  0.0850369855761528
----------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.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.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4340-0.2995j, 0.6915+0.4937j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2780, 0.7220]], grad_fn=<PowBackward0>)
loss:  0.3257544934749603
loss:  0.3259793221950531
loss:  0.2744735777378082
loss:  0.14396797120571136
----------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.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.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6023-0.4575j, 0.5164+0.4015j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5721, 0.4279]], grad_fn=<PowBackward0>)
loss:  0.8488991260528564
loss:  0.5563881397247314
loss:  0.10333021730184555
loss:  0.0004653224896173924
----------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.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.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5621-0.4262j, 0.5599+0.4345j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4977, 0.5023]], grad_fn=<PowBackward0>)
loss:  0.6884881258010864
loss:  0.5598924160003662
loss:  1.1652517318725586
loss:  0.4455464482307434
----------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.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.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4746-0.6779j, 0.3291+0.4549j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6848, 0.3152]], grad_fn=<PowBackward0>)
loss:  0.37860509753227234
loss:  0.1335960328578949
loss:  0.6171203255653381
loss:  0.2748074233531952
----------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.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.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4737-0.1520j, 0.8149+0.2973j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2475, 0.7525]], grad_fn=<PowBackward0>)
loss:  0.2843290865421295
loss:  0.8544997572898865
loss:  1.446568250656128
loss:  0.6918932795524597
----------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.0438+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.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4961-0.3750j, 0.6192+0.4795j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3867, 0.6133]], grad_fn=<PowBackward0>)
loss:  0.4889664351940155
loss:  0.43162739276885986
loss:  0.3265717327594757
loss:  0.5572524070739746
----------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.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.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4096-0.4260j, 0.5601+0.5805j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3493, 0.6507]], grad_fn=<PowBackward0>)
loss:  0.42966026067733765
loss:  0.3268057405948639
loss:  0.3767502009868622
loss:  0.5538923144340515
----------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.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.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6118-0.5890j, 0.3797+0.3669j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7212, 0.2788]], grad_fn=<PowBackward0>)
loss:  0.3268831968307495
loss:  1.0448204278945923
loss:  0.3775264024734497
loss:  0.6219149231910706
----------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.0444+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0222j],
        [0.0000+0.0222j, 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.4721-0.6212j, 0.3843+0.4935j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6088, 0.3912]], grad_fn=<PowBackward0>)
loss:  0.49628153443336487
loss:  0.2744707465171814
loss:  0.4375116229057312
loss:  0.7728308439254761
----------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.0446+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.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5571-0.5789j, 0.4136+0.4283j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6455, 0.3545]], grad_fn=<PowBackward0>)
loss:  0.43776118755340576
loss:  0.1341291218996048
loss:  0.22670094668865204
loss:  0.2750144898891449
----------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.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.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7208-0.5959j, 0.2700+0.2289j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8747, 0.1253]], grad_fn=<PowBackward0>)
loss:  0.13386783003807068
loss:  0.3262804448604584
loss:  0.6283590793609619
loss:  0.55354243516922
----------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.0446+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.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5008-0.6581j, 0.3460+0.4432j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6839, 0.3161]], grad_fn=<PowBackward0>)
loss:  0.3800026774406433
loss:  0.3809713125228882
loss:  0.6184485554695129
loss:  0.17933697998523712
----------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.0444+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0222j],
        [0.0000+0.0222j, 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.1302j, 0.8103+0.2399j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2859, 0.7141]], grad_fn=<PowBackward0>)
loss:  0.33670830726623535
loss:  0.43214139342308044
loss:  0.10292647033929825
loss:  0.029708625748753548
----------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.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.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7933-0.6084j, 0.0135+0.0176j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9951e-01, 4.9024e-04]], grad_fn=<PowBackward0>)
loss:  0.0004903684020973742
loss:  0.3806431293487549
loss:  1.3490190505981445
loss:  1.303178071975708
----------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.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.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6821-0.6088j, 0.3004+0.2717j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8359, 0.1641]], grad_fn=<PowBackward0>)
loss:  0.17923951148986816
loss:  0.22645370662212372
loss:  0.6885516047477722
loss:  0.14310689270496368
----------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.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.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7759-0.5937j, 0.1659+0.1343j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9545, 0.0455]], grad_fn=<PowBackward0>)
loss:  0.046616822481155396
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4463033676147461
------------------------------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.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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2432-0.1967j, 0.7303+0.6073j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0978, 0.9022]], grad_fn=<PowBackward0>)
loss:  0.10296902060508728
loss:  0.8550735712051392
loss:  0.1792358011007309
loss:  0.8475595712661743
----------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.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.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5572-0.5790j, 0.4135+0.4282j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6457, 0.3543]], grad_fn=<PowBackward0>)
loss:  0.4374302923679352
loss:  0.2751455307006836
loss:  0.5574119687080383
loss:  0.32686492800712585
----------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.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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6933-0.5283j, 0.3858+0.3023j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7598, 0.2402]], grad_fn=<PowBackward0>)
loss:  0.2746976613998413
loss:  0.5573369264602661
loss:  0.0004846435913350433
loss:  0.43710264563560486
----------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.0439+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.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5790-0.4032j, 0.5756+0.4134j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4978, 0.5022]], grad_fn=<PowBackward0>)
loss:  0.6887746453285217
loss:  0.18622978031635284
loss:  0.379565566778183
loss:  0.2262837439775467
----------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.0438+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.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4745-0.2992j, 0.6917+0.4550j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3146, 0.6854]], grad_fn=<PowBackward0>)
loss:  0.37779858708381653
loss:  0.3788401186466217
loss:  0.3803117871284485
loss:  0.7766675353050232
----------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.0437+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.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6488-0.6737j, 0.2461+0.2543j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8748, 0.1252]], grad_fn=<PowBackward0>)
loss:  0.13377119600772858
loss:  0.00047742793685756624
loss:  0.3264296352863312
loss:  0.6191319227218628
----------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.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.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6977-0.6230j, 0.2621+0.2375j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8749, 0.1251]], grad_fn=<PowBackward0>)
loss:  0.1336514949798584
loss:  0.4299403131008148
loss:  1.1648918390274048
loss:  0.48906344175338745
----------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.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.1695+0.1286j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9548, 0.0452]], grad_fn=<PowBackward0>)
loss:  0.046303004026412964
loss:  0.6274620890617371
loss:  0.5559281706809998
loss:  0.22987966239452362
----------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.0437+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.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5409-0.4097j, 0.5805+0.4502j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4604, 0.5396]], grad_fn=<PowBackward0>)
loss:  0.6169582605361938
loss:  0.04651903361082077
loss:  0.1790405809879303
loss:  0.4317745268344879
----------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.0438+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.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6044-0.3131j, 0.6421+0.3528j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4633, 0.5367]], grad_fn=<PowBackward0>)
loss:  0.6223499774932861
loss:  1.4463863372802734
loss:  0.13354834914207458
loss:  0.3768935799598694
----------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.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.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5956-0.5733j, 0.4046+0.3909j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6835, 0.3165]], grad_fn=<PowBackward0>)
loss:  0.3805427551269531
loss:  0.445342093706131
loss:  0.2750013768672943
loss:  1.303464651107788
----------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.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.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4867-0.3370j, 0.6554+0.4689j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3505, 0.6495]], grad_fn=<PowBackward0>)
loss:  0.4315328896045685
loss:  0.27474167943000793
loss:  0.6876766085624695
loss:  0.32506728172302246
----------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.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.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5890-0.6118j, 0.3669+0.3797j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7212, 0.2788]], grad_fn=<PowBackward0>)
loss:  0.3268626928329468
loss:  1.3490211963653564
loss:  0.14309367537498474
loss:  1.0447665452957153
----------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.0443+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0222j],
        [0.0000+0.0222j, 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.6193-0.6432j, 0.3129+0.3237j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7973, 0.2027]], grad_fn=<PowBackward0>)
loss:  0.2265075445175171
loss:  0.33672425150871277
loss:  0.3758528232574463
loss:  0.49628791213035583
----------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.0445+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0222j],
        [0.0000+0.0222j, 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.4743-0.6778j, 0.3294+0.4551j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6844, 0.3156]], grad_fn=<PowBackward0>)
loss:  0.37925928831100464
loss:  0.3261679410934448
loss:  0.5536155104637146
loss:  0.14340472221374512
----------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.0445+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.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4736-0.1516j, 0.8150+0.2975j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2472, 0.7528]], grad_fn=<PowBackward0>)
loss:  0.2840067744255066
loss:  0.3269667327404022
loss:  0.7728496193885803
loss:  0.6911144852638245
----------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.0446+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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2431-0.1965j, 0.7303+0.6074j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0977, 0.9023]], grad_fn=<PowBackward0>)
loss:  0.10283398628234863
loss:  0.5610984563827515
loss:  0.08539475500583649
loss:  0.5534622669219971
----------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.0447+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1341-0.1059j, 0.7580+0.6295j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0292, 0.9708]], grad_fn=<PowBackward0>)
loss:  0.029639489948749542
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.44634363055229187
------------------------------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.0447+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.0136+0.0177j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9950e-01, 5.0026e-04]], grad_fn=<PowBackward0>)
loss:  0.0005003869300708175
loss:  0.6880154013633728
loss:  0.22673848271369934
loss:  0.04674023017287254
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.4094-0.4258j, 0.5603+0.5807j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3489, 0.6511]], grad_fn=<PowBackward0>)
loss:  0.42908793687820435
loss:  0.2750695049762726
loss:  0.5612261891365051
loss:  0.6285157203674316
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.6042-0.3128j, 0.6422+0.3531j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4629, 0.5371]], grad_fn=<PowBackward0>)
loss:  0.621563196182251
loss:  0.14287444949150085
loss:  0.772648811340332
loss:  0.17950308322906494
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.6820-0.2730j, 0.6216+0.2719j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5397, 0.4603]], grad_fn=<PowBackward0>)
loss:  0.7758440971374512
loss:  0.13391879200935364
loss:  0.43093517422676086
loss:  0.4379081130027771
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.9050-0.3149j, 0.2637+0.1110j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9181, 0.0819]], grad_fn=<PowBackward0>)
loss:  0.08542792499065399
loss:  0.37717312574386597
loss:  0.275513619184494
loss:  0.5579502582550049
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.6976-0.6228j, 0.2625+0.2379j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8745, 0.1255]], grad_fn=<PowBackward0>)
loss:  0.13410717248916626
loss:  0.8557161688804626
loss:  0.10276653617620468
loss:  0.18585732579231262
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.5346-0.5998j, 0.3984+0.4424j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6455, 0.3545]], grad_fn=<PowBackward0>)
loss:  0.4377099275588989
loss:  0.3811681270599365
loss:  0.376297265291214
loss:  0.37946373224258423
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.3734-0.2560j, 0.7260+0.5177j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2050, 0.7950]], grad_fn=<PowBackward0>)
loss:  0.22936208546161652
loss:  0.17948275804519653
loss:  0.37561461329460144
loss:  0.029633840546011925
----------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.0447+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.5629j, 0.1698+0.1290j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9545, 0.0455]], grad_fn=<PowBackward0>)
loss:  0.046530336141586304
loss:  1.1635788679122925
loss:  1.0441782474517822
loss:  0.336590975522995
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.5799-0.2995j, 0.6642+0.3644j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4260, 0.5740]], grad_fn=<PowBackward0>)
loss:  0.5551400184631348
loss:  1.3489958047866821
loss:  1.4450634717941284
loss:  0.4965965449810028
----------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.0448+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.6337-0.5651j, 0.3923+0.3537j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7210, 0.2790]], grad_fn=<PowBackward0>)
loss:  0.3271510899066925
loss:  0.6908767819404602
loss:  0.32716646790504456
loss:  0.5533186197280884
----------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.0449+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0224j],
        [0.0000+0.0224j, 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.8074-0.2760j, 0.4864+0.1879j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7281, 0.2719]], grad_fn=<PowBackward0>)
loss:  1.3024574518203735
loss:  0.5532937049865723
loss:  0.8467238545417786
loss:  0.5580400824546814
----------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.0450+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.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5888-0.6116j, 0.3672+0.3800j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7208, 0.2792]], grad_fn=<PowBackward0>)
loss:  0.3273872435092926
loss:  0.32453620433807373
loss:  0.32648977637290955
loss:  0.0005069467588327825
----------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.0450+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.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3022-0.2052j, 0.7584+0.5398j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1334, 0.8666]], grad_fn=<PowBackward0>)
loss:  0.14320895075798035
loss:  0.3811677098274231
loss:  0.3796370029449463
loss:  0.6179486513137817
----------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.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.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5806-0.1484j, 0.7671+0.2291j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3591, 0.6409]], grad_fn=<PowBackward0>)
loss:  0.44489696621894836
loss:  0.6157443523406982
loss:  0.10268588364124298
loss:  0.2741263210773468
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.6192-0.6431j, 0.3132+0.3239j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7970, 0.2030]], grad_fn=<PowBackward0>)
loss:  0.22691279649734497
loss:  0.32747241854667664
loss:  0.2756679058074951
loss:  0.43260833621025085
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.6486-0.6735j, 0.2466+0.2547j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8743, 0.1257]], grad_fn=<PowBackward0>)
loss:  0.13430185616016388
loss:  0.2837968170642853
loss:  0.6866374015808105
loss:  0.38037681579589844
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.4958-0.3746j, 0.6194+0.4798j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3861, 0.6139]], grad_fn=<PowBackward0>)
loss:  0.48791709542274475
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.446372926235199
------------------------------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.4468-0.3367j, 0.6556+0.5071j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3130, 0.6870]], grad_fn=<PowBackward0>)
loss:  0.37536904215812683
loss:  1.3022077083587646
loss:  0.1796475350856781
loss:  0.13403676450252533
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.4735-0.1514j, 0.8151+0.2976j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2471, 0.7529]], grad_fn=<PowBackward0>)
loss:  0.2837904691696167
loss:  0.5581803321838379
loss:  0.3813997507095337
loss:  0.37607264518737793
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.6116-0.5888j, 0.3800+0.3672j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7207, 0.2793]], grad_fn=<PowBackward0>)
loss:  0.32748547196388245
loss:  0.43261605501174927
loss:  0.49683672189712524
loss:  0.1431710571050644
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.0150+0.0168j,  0.7452+0.6665j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[5.0918e-04, 9.9949e-01]], grad_fn=<PowBackward0>)
loss:  0.0005093321669846773
loss:  0.37699419260025024
loss:  0.2741036117076874
loss:  0.3273289203643799
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.2430-0.1963j, 0.7304+0.6074j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0976, 0.9024]], grad_fn=<PowBackward0>)
loss:  0.10266805440187454
loss:  0.029568392783403397
loss:  0.14274732768535614
loss:  0.5531272888183594
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.8097-0.3295j, 0.4426+0.1998j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7642, 0.2358]], grad_fn=<PowBackward0>)
loss:  1.444632887840271
loss:  0.558179497718811
loss:  0.08548843860626221
loss:  0.1857231855392456
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.6228j, 0.2626+0.2380j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8744, 0.1256]], grad_fn=<PowBackward0>)
loss:  0.13422058522701263
loss:  0.3265708088874817
loss:  0.13431064784526825
loss:  0.3364655375480652
----------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.0451+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.6662-0.3071j, 0.6089+0.3020j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5381, 0.4619]], grad_fn=<PowBackward0>)
loss:  0.7723544239997864
loss:  1.0436949729919434
loss:  0.48789313435554504
loss:  0.43814724683761597
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.0137+0.0179j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.9949e-01, 5.0979e-04]], grad_fn=<PowBackward0>)
loss:  0.0005099285044707358
loss:  0.8560467958450317
loss:  0.17966100573539734
loss:  1.1630859375
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5345-0.5997j, 0.3985+0.4425j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6453, 0.3547]], grad_fn=<PowBackward0>)
loss:  0.437970906496048
loss:  0.22694167494773865
loss:  1.348980188369751
loss:  0.6288530826568604
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5499-0.6169j, 0.3769+0.4182j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6830, 0.3170]], grad_fn=<PowBackward0>)
loss:  0.38124799728393555
loss:  0.04682230204343796
loss:  0.2291766256093979
loss:  0.5548670291900635
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5651-0.3249j, 0.6490+0.3924j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4248, 0.5752]], grad_fn=<PowBackward0>)
loss:  0.5531120300292969
loss:  0.4288153648376465
loss:  0.3803991377353668
loss:  0.6178575158119202
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5406-0.4093j, 0.5808+0.4505j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4597, 0.5403]], grad_fn=<PowBackward0>)
loss:  0.6156590580940247
loss:  0.2269400954246521
loss:  0.27568933367729187
loss:  0.7755696177482605
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.4334-0.2987j, 0.6919+0.4942j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2771, 0.7229]], grad_fn=<PowBackward0>)
loss:  0.32443633675575256
loss:  0.2756929397583008
loss:  0.5615490674972534
loss:  0.37971681356430054
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.2429-0.1963j, 0.7304+0.6074j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0976, 0.9024]], grad_fn=<PowBackward0>)
loss:  0.10265497863292694
loss:  0.3797159492969513
loss:  0.32750368118286133
loss:  0.4448535442352295
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5629j, 0.1699+0.1292j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9545, 0.0455]], grad_fn=<PowBackward0>)
loss:  0.046618323773145676
loss:  0.3273490369319916
loss:  0.43070289492607117
loss:  0.6865962147712708
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.5787-0.4028j, 0.5758+0.4138j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4972, 0.5028]], grad_fn=<PowBackward0>)
loss:  0.6876267194747925
loss:  0.621279239654541
loss:  0.27527275681495667
loss:  0.6906014680862427
----------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.0452+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 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.4569j, 0.5169+0.4021j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5711, 0.4289]], grad_fn=<PowBackward0>)
loss:  0.846458375453949
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4463767111301422
--------------------Test--------------------
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
New state:  tensor([[0.6431-0.2956j, 0.6332+0.3132j]])
----------Measure----------
Probability:  tensor([[0.5010, 0.4990]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
New state:  tensor([[0.2164-0.1299j, 0.8103+0.5288j]])
----------Measure----------
Probability:  tensor([[0.0637, 0.9363]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5499-0.6169j, 0.3769+0.4182j]])
----------Measure----------
Probability:  tensor([[0.6830, 0.3170]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6719-0.5546j, 0.3755+0.3161j]])
----------Measure----------
Probability:  tensor([[0.7590, 0.2410]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7102-0.5415j, 0.3538+0.2780j]])
----------Measure----------
Probability:  tensor([[0.7976, 0.2024]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
New state:  tensor([[0.5958-0.7208j, 0.2291+0.2701j]])
----------Measure----------
Probability:  tensor([[0.8745, 0.1255]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
New state:  tensor([[0.3872-0.5570j, 0.4284+0.5968j]])
----------Measure----------
Probability:  tensor([[0.4602, 0.5398]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
New state:  tensor([[0.6975-0.2342j, 0.6340+0.2380j]])
----------Measure----------
Probability:  tensor([[0.5414, 0.4586]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4742-0.2987j, 0.6919+0.4553j]])
----------Measure----------
Probability:  tensor([[0.3141, 0.6859]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
New state:  tensor([[0.4569-0.6019j, 0.4021+0.5169j]])
----------Measure----------
Probability:  tensor([[0.5711, 0.4289]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
New state:  tensor([[0.3071-0.6662j, 0.3020+0.6089j]])
----------Measure----------
Probability:  tensor([[0.5381, 0.4619]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5236-0.5442j, 0.4553+0.4716j]])
----------Measure----------
Probability:  tensor([[0.5703, 0.4297]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5731-0.3640j, 0.6124+0.4050j]])
----------Measure----------
Probability:  tensor([[0.4609, 0.5391]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7102-0.5415j, 0.3538+0.2780j]])
----------Measure----------
Probability:  tensor([[0.7976, 0.2024]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5888-0.6116j, 0.3672+0.3800j]])
----------Measure----------
Probability:  tensor([[0.7207, 0.2793]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
New state:  tensor([[0.5570-0.3872j, 0.5968+0.4284j]])
----------Measure----------
Probability:  tensor([[0.4602, 0.5398]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
New state:  tensor([[0.5731-0.5954j, 0.3913+0.4050j]])
----------Measure----------
Probability:  tensor([[0.6829, 0.3171]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
New state:  tensor([[0.2159-0.6486j, 0.2547+0.6840j]])
----------Measure----------
Probability:  tensor([[0.4673, 0.5327]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
New state:  tensor([[0.2515-0.1859j, 0.7525+0.5796j]])
----------Measure----------
Probability:  tensor([[0.0978, 0.9022]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
New state:  tensor([[0.7283-0.6508j, 0.1582+0.1448j]])
----------Measure----------
Probability:  tensor([[0.9540, 0.0460]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
New state:  tensor([[0.6501-0.3380j, 0.5957+0.3290j]])
----------Measure----------
Probability:  tensor([[0.5368, 0.4632]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5651-0.6337j, 0.3539+0.3924j]])
----------Measure----------
Probability:  tensor([[0.7208, 0.2792]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
New state:  tensor([[0.6885-0.5685j, 0.3442+0.2903j]])
----------Measure----------
Probability:  tensor([[0.7973, 0.2027]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4742-0.6777j, 0.3297+0.4553j]])
----------Measure----------
Probability:  tensor([[0.6841, 0.3159]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
New state:  tensor([[0.5145-0.2944j, 0.6898+0.4158j]])
----------Measure----------
Probability:  tensor([[0.3514, 0.6486]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5617-0.4257j, 0.5604+0.4351j]])
----------Measure----------
Probability:  tensor([[0.4967, 0.5033]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
New state:  tensor([[0.4640-0.4125j, 0.5832+0.5238j]])
----------Measure----------
Probability:  tensor([[0.3854, 0.6146]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6820-0.2729j, 0.6216+0.2721j]])
----------Measure----------
Probability:  tensor([[0.5396, 0.4604]])
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.0452+0.j]])
rx_matrix:  tensor([[0.9997+0.0000j, 0.0000+0.0226j],
        [0.0000+0.0226j, 0.9997+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
New state:  tensor([[0.5404-0.6550j, 0.3399+0.4043j]])
----------Measure----------
Probability:  tensor([[0.7210, 0.2790]])
test set accuracy: 0.7931034564971924
test set loss: 0.4463767111301422
