------------------------------Epoch1------------------------------
--------------------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  ry
ry_matrix theta:  tensor([[-0.0235+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999+0.j,  0.0118-0.j],
        [-0.0118+0.j,  0.9999+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4792-0.3278j, 0.6611+0.4753j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6853+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6655-0.7464j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6655+0.7464j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4792-0.3278j, 0.6611+0.4753j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0743-0.5758j, 0.0852+0.8097j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3371, 0.6629]], grad_fn=<PowBackward0>)
loss:  0.41109341382980347
loss:  0.46202459931373596
loss:  0.8289350867271423
loss:  0.41198697686195374
----------index4----------
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  ry
ry_matrix theta:  tensor([[-0.0220+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999+0.j,  0.0110-0.j],
        [-0.0110+0.j,  0.9999+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6828-0.5596j, 0.3554+0.3071j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6833+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6662-0.7457j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6662+0.7457j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6828-0.5596j, 0.3554+0.3071j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0376-0.8820j, 0.0078+0.4696j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7794, 0.2206]], grad_fn=<PowBackward0>)
loss:  0.24922868609428406
loss:  0.46698999404907227
loss:  0.11704394966363907
loss:  0.00011134767555631697
----------index8----------
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  ry
ry_matrix theta:  tensor([[-0.0209+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999+0.j,  0.0104-0.j],
        [-0.0104+0.j,  0.9999+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5139-0.6611j, 0.3259+0.4388j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6813+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6670-0.7451j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6670+0.7451j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5139-0.6611j, 0.3259+0.4388j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1498-0.8239j, -0.1096+0.5355j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7012, 0.2988]], grad_fn=<PowBackward0>)
loss:  0.3549782633781433
loss:  0.7364431023597717
loss:  0.255019873380661
loss:  0.8217570781707764
----------index12----------
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  ry
ry_matrix theta:  tensor([[-0.0197+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0099-0.j],
        [-0.0099+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.8027-0.5654j, 0.1492+0.1167j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6793+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6677-0.7444j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6677+0.7444j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8027-0.5654j, 0.1492+0.1167j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1151-0.9751j, 0.0128+0.1890j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9641, 0.0359]], grad_fn=<PowBackward0>)
loss:  0.03654627874493599
loss:  0.1625208705663681
loss:  1.234985113143921
loss:  0.5896695852279663
----------index16----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[-0.0184+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0092-0.j],
        [-0.0092+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.7032-0.5341j, 0.3676+0.2918j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6773+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6685-0.7437j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6685+0.7437j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7032-0.5341j, 0.3676+0.2918j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0729-0.8800j, 0.0287+0.4685j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7797, 0.2203]], grad_fn=<PowBackward0>)
loss:  0.2488270401954651
loss:  0.16293257474899292
loss:  0.159582257270813
loss:  0.2974614202976227
----------index20----------
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  ry
ry_matrix theta:  tensor([[-0.0174+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0087-0.j],
        [-0.0087+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4220-0.6411j, 0.3438+0.5410j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6753+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6692-0.7431j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6692+0.7431j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4220-0.6411j, 0.3438+0.5410j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1939-0.7426j, -0.1720+0.6175j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5891, 0.4109]], grad_fn=<PowBackward0>)
loss:  0.5291603207588196
loss:  0.07326419651508331
loss:  0.6634669899940491
loss:  1.1100072860717773
----------index24----------
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  ry
ry_matrix theta:  tensor([[-0.0165+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0082-0.j],
        [-0.0082+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.6073-0.5790j, 0.3870+0.3825j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6733+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6700-0.7424j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6700+0.7424j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6073-0.5790j, 0.3870+0.3825j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0230-0.8387j, -0.0247+0.5435j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7040, 0.2960]], grad_fn=<PowBackward0>)
loss:  0.35104161500930786
loss:  0.11890105903148651
loss:  0.9029102921485901
loss:  0.36013486981391907
----------index28----------
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  ry
ry_matrix theta:  tensor([[-0.0154+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0077-0.j],
        [-0.0077+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6560-0.6770j, 0.2263+0.2452j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6713+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6707-0.7417j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6707+0.7417j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6560-0.6770j, 0.2263+0.2452j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0622-0.9406j, -0.0301+0.3323j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8887, 0.1113]], grad_fn=<PowBackward0>)
loss:  0.11803572624921799
loss:  0.7361065149307251
loss:  0.11879647523164749
loss:  1.3690050840377808
----------index32----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[-0.0141+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0070-0.j],
        [-0.0070+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6284-0.6478j, 0.2942+0.3144j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6693+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6714-0.7411j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6714+0.7411j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6284-0.6478j, 0.2942+0.3144j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0581-0.9007j, -0.0355+0.4291j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8146, 0.1854]], grad_fn=<PowBackward0>)
loss:  0.20508085191249847
loss:  0.30043530464172363
loss:  0.4058377146720886
loss:  0.35236531496047974
----------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  ry
ry_matrix theta:  tensor([[-0.0128+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0064-0.j],
        [-0.0064+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5468-0.6058j, 0.3814+0.4342j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6673+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6722-0.7404j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6722+0.7404j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5468-0.6058j, 0.3814+0.4342j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0810-0.8120j, -0.0651+0.5743j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6660, 0.3340]], grad_fn=<PowBackward0>)
loss:  0.40649038553237915
loss:  0.250104695558548
loss:  0.299322247505188
loss:  0.3003928065299988
----------index40----------
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  ry
ry_matrix theta:  tensor([[-0.0119+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0059-0.j],
        [-0.0059+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.5007-0.3486j, 0.6449+0.4602j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6653+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6729-0.7397j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6729+0.7397j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5007-0.3486j, 0.6449+0.4602j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0791-0.6050j, 0.0935+0.7867j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3723, 0.6277]], grad_fn=<PowBackward0>)
loss:  0.4656808376312256
loss:  0.353946328163147
loss:  0.4099927842617035
loss:  0.5236020684242249
----------index44----------
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  ry
ry_matrix theta:  tensor([[-0.0110+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0055-0.j],
        [-0.0055+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7272-0.6006j, 0.2526+0.2161j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6633+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6736-0.7391j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6736+0.7391j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7272-0.6006j, 0.2526+0.2161j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0460-0.9420j, 0.0105+0.3322j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8895, 0.1105]], grad_fn=<PowBackward0>)
loss:  0.11709112673997879
loss:  0.5924414992332458
loss:  0.6594148278236389
loss:  0.6622952818870544
----------index48----------
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  ry
ry_matrix theta:  tensor([[-0.0100+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0050-0.j],
        [-0.0050+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1519-0.1197j, 0.7547+0.6270j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6613+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6744-0.7384j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6744+0.7384j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1519-0.1197j, 0.7547+0.6270j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0141-0.1929j, 0.0460+0.9800j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0374, 0.9626]], grad_fn=<PowBackward0>)
loss:  0.038126371800899506
loss:  1.3663972616195679
loss:  0.03728923946619034
loss:  0.40711089968681335
----------index52----------
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  ry
ry_matrix theta:  tensor([[-0.0086+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0043-0.j],
        [-0.0043+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3642-0.2321j, 0.7557+0.4923j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6594+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6751-0.7377j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6751+0.7377j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3642-0.2321j, 0.7557+0.4923j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0746-0.4254j, 0.1470+0.8899j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1866, 0.8134]], grad_fn=<PowBackward0>)
loss:  0.20647260546684265
loss:  0.300655722618103
loss:  1.5497327694902197e-05
loss:  0.5915740728378296
----------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  ry
ry_matrix theta:  tensor([[-0.0073+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0036-0.j],
        [-0.0036+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4203-0.6438j, 0.3459+0.5378j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6574+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6758-0.7370j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6758+0.7370j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4203-0.6438j, 0.3459+0.5378j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1905-0.7449j, -0.1626+0.6184j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5911, 0.4089]], grad_fn=<PowBackward0>)
loss:  0.5257142186164856
loss:  1.513234257698059
loss:  0.8155280947685242
loss:  0.5904029607772827
----------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  ry
ry_matrix theta:  tensor([[-0.0056+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0028-0.j],
        [-0.0028+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6272-0.6491j, 0.2968+0.3117j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6554+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6766-0.7364j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6766+0.7364j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6272-0.6491j, 0.2968+0.3117j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0537-0.9010j, -0.0287+0.4295j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8147, 0.1853]], grad_fn=<PowBackward0>)
loss:  0.20489947497844696
loss:  0.2999953627586365
loss:  0.5242834687232971
loss:  0.733107328414917
----------index64----------
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  ry
ry_matrix theta:  tensor([[-0.0041+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0020-0.j],
        [-0.0020+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4850-0.6840j, 0.3133+0.4458j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6534+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6773-0.7357j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6773+0.7357j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4850-0.6840j, 0.3133+0.4458j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1748-0.8201j, -0.1158+0.5325j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7031, 0.2969]], grad_fn=<PowBackward0>)
loss:  0.3522770404815674
loss:  0.30180004239082336
loss:  0.16019253432750702
loss:  0.46454665064811707
----------index68----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.5443+0.j, 0.8389+0.j]])
New state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[-0.0026+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0013-0.j],
        [-0.0013+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4453-0.3137j, 0.6844+0.4847j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6514+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6780-0.7350j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6780+0.7350j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4453-0.3137j, 0.6844+0.4847j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0714-0.5400j, 0.1077+0.8317j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2967, 0.7033]], grad_fn=<PowBackward0>)
loss:  0.35195156931877136
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.4441783130168915
------------------------------Epoch2------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[-0.0022+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000+0.j,  0.0011-0.j],
        [-0.0011+0.j,  1.0000+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5670-0.5875j, 0.4000+0.4164j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6509+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6782-0.7349j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6782+0.7349j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5670-0.5875j, 0.4000+0.4164j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0472-0.8151j, -0.0347+0.5763j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6666, 0.3334]], grad_fn=<PowBackward0>)
loss:  0.40552273392677307
loss:  0.3517080247402191
loss:  0.8121216297149658
loss:  0.29993075132369995
----------index4----------
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  ry
ry_matrix theta:  tensor([[-0.0008+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000e+00+0.j,  4.0462e-04-0.j],
        [-4.0462e-04+0.j,  1.0000e+00+0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6110-0.4683j, 0.5062+0.3886j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6489+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6789-0.7342j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6789+0.7342j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6110-0.4683j, 0.5062+0.3886j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0710-0.7666j, 0.0584+0.6355j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5927, 0.4073]], grad_fn=<PowBackward0>)
loss:  0.8981946706771851
loss:  0.462936669588089
loss:  0.16035471856594086
loss:  1.216166615486145
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.0006+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000e+00-0.j, -3.2364e-04-0.j],
        [ 3.2364e-04+0.j,  1.0000e+00-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5504-0.4224j, 0.5716+0.4381j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6470+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6797-0.7335j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6797+0.7335j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5504-0.4224j, 0.5716+0.4381j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0642-0.6908j, 0.0671+0.7170j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4814, 0.5186]], grad_fn=<PowBackward0>)
loss:  0.656618058681488
loss:  0.07719173282384872
loss:  0.6562359929084778
loss:  0.405147910118103
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0021+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0010-0.j],
        [ 0.0010+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4840-0.6854j, 0.3148+0.4437j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6450+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6804-0.7328j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6804+0.7328j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4840-0.6854j, 0.3148+0.4437j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1730-0.8210j, -0.1110+0.5326j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7040, 0.2960]], grad_fn=<PowBackward0>)
loss:  0.3509511947631836
loss:  0.5224393606185913
loss:  0.586431086063385
loss:  2.3841885194997303e-06
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0034+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0017-0.j],
        [ 0.0017+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5224-0.1485j, 0.8081+0.2281j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6430+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6811-0.7322j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6811+0.7322j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5224-0.1485j, 0.8081+0.2281j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2471-0.4837j, 0.3834+0.7470j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2950, 0.7050]], grad_fn=<PowBackward0>)
loss:  0.349515825510025
loss:  0.300189346075058
loss:  0.46181437373161316
loss:  0.2519263029098511
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0047+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0023-0.j],
        [ 0.0023+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8595+0.j, 0.5112+0.j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6411+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6818-0.7315j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6818+0.7315j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8595+0.j, 0.5112+0.j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5860-0.6287j, 0.3485+0.3739j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7387, 0.2613]], grad_fn=<PowBackward0>)
loss:  1.3420838117599487
loss:  0.1605820208787918
loss:  0.29999077320098877
loss:  0.20469947159290314
----------index24----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
New state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0060+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0030-0.j],
        [ 0.0030+0.j,  1.0000-0.j]], 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.0022-0.0020j,  0.7454+0.6667j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6391+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6826-0.7308j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6826+0.7308j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0022-0.0020j,  0.7454+0.6667j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0030+2.7048e-04j,  0.0215+9.9976e-01j]],
       grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[9.0897e-06, 9.9999e-01]], grad_fn=<PowBackward0>)
loss:  9.179157132166438e-06
loss:  0.3515550196170807
loss:  0.404957115650177
loss:  0.5848814845085144
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.0070+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0035-0.j],
        [ 0.0035+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.7010-0.4168j, 0.4994+0.2925j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6371+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6833-0.7302j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6833+0.7302j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7010-0.4168j, 0.4994+0.2925j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1746-0.7966j, 0.1276+0.5645j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6651, 0.3349]], grad_fn=<PowBackward0>)
loss:  1.0938372611999512
loss:  0.03823120892047882
loss:  0.15930207073688507
loss:  0.11728392541408539
----------index32----------
train inputs:  tensor([[1.6821, 2.0731]], 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.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([[2.0731]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.0731+0.j]])
rz_matrix:  tensor([[0.5092-0.8607j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5092+0.8607j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0081+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0040-0.j],
        [ 0.0040+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3379-0.5764j, 0.3809+0.6392j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6352+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6840-0.7295j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6840+0.7295j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3379-0.5764j, 0.3809+0.6392j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1893-0.6407j, -0.2058+0.7150j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4464, 0.5536]], grad_fn=<PowBackward0>)
loss:  0.8065963983535767
loss:  0.2521519064903259
loss:  0.8049131631851196
loss:  0.30069953203201294
----------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  ry
ry_matrix theta:  tensor([[0.0091+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0046-0.j],
        [ 0.0046+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4174-0.6482j, 0.3493+0.5325j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6332+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6847-0.7288j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6847+0.7288j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4174-0.6482j, 0.3493+0.5325j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1866-0.7481j, -0.1489+0.6192j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5944, 0.4056]], grad_fn=<PowBackward0>)
loss:  0.5201834440231323
loss:  0.4032699465751648
loss:  0.11767715215682983
loss:  0.7259629368782043
----------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  ry
ry_matrix theta:  tensor([[0.0101+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0051-0.j],
        [ 0.0051+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3571-0.2367j, 0.7590+0.4902j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6312+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6854-0.7282j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6854+0.7282j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3571-0.2367j, 0.7590+0.4902j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0724-0.4223j, 0.1634+0.8887j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1836, 0.8164]], grad_fn=<PowBackward0>)
loss:  0.20284494757652283
loss:  0.11821609735488892
loss:  0.727206289768219
loss:  0.6509589552879333
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0112+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0056-0.j],
        [ 0.0056+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4826-0.6874j, 0.3170+0.4406j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6293+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6861-0.7275j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6861+0.7275j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4826-0.6874j, 0.3170+0.4406j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1690-0.8227j, -0.1030+0.5329j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7054, 0.2946]], grad_fn=<PowBackward0>)
loss:  0.3489970266819
loss:  0.2046171873807907
loss:  0.5827503204345703
loss:  0.4595695436000824
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.0123+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0062-0.j],
        [ 0.0062+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3628-0.3570j, 0.6220+0.5950j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6273+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6868-0.7268j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6868+0.7268j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3628-0.3570j, 0.6220+0.5950j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0103-0.5089j, -0.0053+0.8608j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2591, 0.7409]], grad_fn=<PowBackward0>)
loss:  0.2998596429824829
loss:  0.34870681166648865
loss:  0.16097094118595123
loss:  0.4017341136932373
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.0133+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0066-0.j],
        [ 0.0066+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1431-0.1270j, 0.7564+0.6255j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6254+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6875-0.7261j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6875+0.7261j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1431-0.1270j, 0.7564+0.6255j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0062-0.1912j, 0.0658+0.9793j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0366, 0.9634]], grad_fn=<PowBackward0>)
loss:  0.037300437688827515
loss:  1.4863399267196655
loss:  0.35042786598205566
loss:  0.5228291153907776
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.0144+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0072-0.j],
        [ 0.0072+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7239-0.6033j, 0.2618+0.2084j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6234+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6883-0.7255j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6883+0.7255j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7239-0.6033j, 0.2618+0.2084j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0606-0.9404j, 0.0290+0.3334j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8880, 0.1120]], grad_fn=<PowBackward0>)
loss:  0.11877492815256119
loss:  0.03853977844119072
loss:  0.3996501863002777
loss:  0.25285717844963074
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0154+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0077-0.j],
        [ 0.0077+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8077-0.2882j, 0.4863+0.1675j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6215+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6890-0.7248j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6890+0.7248j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8077-0.2882j, 0.4863+0.1675j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3476-0.7840j, 0.2136+0.4679j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7355, 0.2645]], grad_fn=<PowBackward0>)
loss:  1.3298189640045166
loss:  0.586240828037262
loss:  0.1167919710278511
loss:  0.24846476316452026
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.0166+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0083-0.j],
        [ 0.0083+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4177-0.4429j, 0.5541+0.5677j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6195+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6897-0.7241j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6897+0.7241j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4177-0.4429j, 0.5541+0.5677j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0327-0.6080j, -0.0290+0.7928j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3707, 0.6293]], grad_fn=<PowBackward0>)
loss:  0.46312257647514343
loss:  0.726371705532074
loss:  0.2923351228237152
loss:  0.2990148067474365
----------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  ry
ry_matrix theta:  tensor([[0.0176+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0088-0.j],
        [ 0.0088+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.5011-0.3926j, 0.6153+0.4651j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6176+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6904-0.7234j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6904+0.7234j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5011-0.3926j, 0.6153+0.4651j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0619-0.6335j, 0.0883+0.7662j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4052, 0.5948]], grad_fn=<PowBackward0>)
loss:  0.5194982290267944
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.43943098187446594
------------------------------Epoch3------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0178+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0089-0.j],
        [ 0.0089+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6063-0.3301j, 0.6405+0.3365j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6171+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6906-0.7233j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6906+0.7233j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6063-0.3301j, 0.6405+0.3365j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1799-0.6665j, 0.1989+0.6956j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4765, 0.5235]], grad_fn=<PowBackward0>)
loss:  0.6472766399383545
loss:  1.3195903301239014
loss:  0.25321438908576965
loss:  0.5169036388397217
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.0193+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 1.0000-0.j, -0.0096-0.j],
        [ 0.0096+0.j,  1.0000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3537-0.2390j, 0.7607+0.4891j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6152+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6913-0.7226j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6913+0.7226j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3537-0.2390j, 0.7607+0.4891j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0718-0.4208j, 0.1724+0.8877j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1822, 0.8178]], grad_fn=<PowBackward0>)
loss:  0.20112568140029907
loss:  0.3519260585308075
loss:  1.4778915643692017
loss:  0.16137325763702393
----------index8----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0207+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0104-0.j],
        [ 0.0104+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6232-0.6532j, 0.3051+0.3031j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6132+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6919-0.7220j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6919+0.7220j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6232-0.6532j, 0.3051+0.3031j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0403-0.9019j, -0.0077+0.4300j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8150, 0.1850]], grad_fn=<PowBackward0>)
loss:  0.20451129972934723
loss:  0.44898882508277893
loss:  0.7202182412147522
loss:  0.4049530029296875
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0222+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0111-0.j],
        [ 0.0111+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6373-0.5775j, 0.3866+0.3331j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6113+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6926-0.7213j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6926+0.7213j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6373-0.5775j, 0.3866+0.3331j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0248-0.8596j, 0.0275+0.5095j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7396, 0.2604]], grad_fn=<PowBackward0>)
loss:  0.3016437590122223
loss:  0.0001264294405700639
loss:  0.45687389373779297
loss:  0.403722882270813
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0233+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0116-0.j],
        [ 0.0116+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2969-0.2408j, 0.7359+0.5589j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6094+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6933-0.7206j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6933+0.7206j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2969-0.2408j, 0.7359+0.5589j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0323-0.3809j, 0.1074+0.9178j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1461, 0.8539]], grad_fn=<PowBackward0>)
loss:  0.15793900191783905
loss:  0.11636387556791306
loss:  0.29967576265335083
loss:  0.39616480469703674
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0242+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0121-0.j],
        [ 0.0121+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6952-0.5401j, 0.3825+0.2804j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6075+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6940-0.7200j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6940+0.7200j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6952-0.5401j, 0.3825+0.2804j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0936-0.8754j, 0.0636+0.4700j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7751, 0.2249]], grad_fn=<PowBackward0>)
loss:  0.2547776997089386
loss:  0.28904348611831665
loss:  0.3473552167415619
loss:  0.5149486064910889
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.0250+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0125-0.j],
        [ 0.0125+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5286-0.5600j, 0.4496+0.4526j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6056+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6947-0.7193j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6947+0.7193j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5286-0.5600j, 0.4496+0.4526j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0356-0.7693j, -0.0133+0.6378j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5930, 0.4070]], grad_fn=<PowBackward0>)
loss:  0.5225282311439514
loss:  0.45768001675605774
loss:  0.3007681369781494
loss:  0.34964534640312195
----------index28----------
train inputs:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0258+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0129-0.j],
        [ 0.0129+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6799-0.2902j, 0.6241+0.2529j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6037+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6954-0.7186j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6954+0.7186j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6799-0.2902j, 0.6241+0.2529j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2643-0.6904j, 0.2523+0.6244j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5465, 0.4535]], grad_fn=<PowBackward0>)
loss:  0.7907731533050537
loss:  0.16169193387031555
loss:  0.5176678895950317
loss:  0.4007066488265991
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.0267+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0134-0.j],
        [ 0.0134+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6775-0.5279j, 0.4131+0.3029j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.6018+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6961-0.7180j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6961+0.7180j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6775-0.5279j, 0.4131+0.3029j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0926-0.8538j, 0.0701+0.5074j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7376, 0.2624]], grad_fn=<PowBackward0>)
loss:  0.30432650446891785
loss:  0.00018085684860125184
loss:  0.24663785099983215
loss:  0.25414329767227173
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.0273+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0137-0.j],
        [ 0.0137+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5638-0.4440j, 0.5584+0.4163j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5999+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6968-0.7173j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6968+0.7173j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5638-0.4440j, 0.5584+0.4163j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0744-0.7138j, 0.0904+0.6905j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5150, 0.4850]], grad_fn=<PowBackward0>)
loss:  0.7235459685325623
loss:  0.5742594599723816
loss:  0.3455403745174408
loss:  1.079624891281128
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.0281+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0141-0.j],
        [ 0.0141+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5647-0.3448j, 0.6495+0.3747j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5980+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6974-0.7166j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6974+0.7166j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5647-0.3448j, 0.6495+0.3747j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1468-0.6451j, 0.1845+0.7268j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4377, 0.5623]], grad_fn=<PowBackward0>)
loss:  0.5757898688316345
loss:  0.11907541006803513
loss:  0.039811111986637115
loss:  0.34529930353164673
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0291+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0145-0.j],
        [ 0.0145+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6034-0.4741j, 0.5153+0.3816j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5961+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6981-0.7160j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6981+0.7160j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6034-0.4741j, 0.5153+0.3816j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0818-0.7630j, 0.0865+0.6353j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5889, 0.4111]], grad_fn=<PowBackward0>)
loss:  0.8888044953346252
loss:  0.5849241614341736
loss:  0.11604399234056473
loss:  0.46355825662612915
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.0299+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0149-0.j],
        [ 0.0149+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3574-0.3622j, 0.6252+0.5919j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5942+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6988-0.7153j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6988+0.7153j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3574-0.3622j, 0.6252+0.5919j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0094-0.5087j,  0.0135+0.8608j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2589, 0.7411]], grad_fn=<PowBackward0>)
loss:  0.29959532618522644
loss:  0.11758711189031601
loss:  0.6450198292732239
loss:  0.08387292921543121
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.0305+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0152-0.j],
        [ 0.0152+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4612-0.3405j, 0.6738+0.4663j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5922+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.6995-0.7147j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.6995+0.7147j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4612-0.3405j, 0.6738+0.4663j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0793-0.5677j, 0.1381+0.8077j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3286, 0.6714]], grad_fn=<PowBackward0>)
loss:  0.3984222412109375
loss:  0.03952440991997719
loss:  0.20443429052829742
loss:  0.7893831729888916
----------index56----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.1925+0.j, 0.9813+0.j]])
New state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0310+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0155-0.j],
        [ 0.0155+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1364-0.1325j, 0.7576+0.6244j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5903+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7002-0.7140j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7002+0.7140j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1364-0.1325j, 0.7576+0.6244j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0009-0.1902j, 0.0847+0.9781j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0362, 0.9638]], grad_fn=<PowBackward0>)
loss:  0.03684542700648308
loss:  0.33443668484687805
loss:  0.6489805579185486
loss:  0.12007538974285126
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0318+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0159-0.j],
        [ 0.0159+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7493-0.3647j, 0.5033+0.2285j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5884+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7008-0.7133j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7008+0.7133j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7493-0.3647j, 0.5033+0.2285j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2650-0.7901j, 0.1898+0.5192j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6945, 0.3055]], grad_fn=<PowBackward0>)
loss:  1.1856530904769897
loss:  0.5741110444068909
loss:  0.3963070809841156
loss:  0.344505250453949
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.0330+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0165-0.j],
        [ 0.0165+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3018-0.2310j, 0.7587+0.5291j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5865+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7015-0.7127j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7015+0.7127j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3018-0.2310j, 0.7587+0.5291j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0471-0.3771j, 0.1551+0.9119j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1444, 0.8556]], grad_fn=<PowBackward0>)
loss:  0.15599152445793152
loss:  0.7931126952171326
loss:  0.29808253049850464
loss:  0.719217836856842
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.0342+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0171-0.j],
        [ 0.0171+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8031-0.2897j, 0.4939+0.1648j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5846+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7022-0.7120j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7022+0.7120j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8031-0.2897j, 0.4939+0.1648j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3576-0.7753j, 0.2294+0.4673j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7290, 0.2710]], grad_fn=<PowBackward0>)
loss:  1.3054654598236084
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.43556681275367737
------------------------------Epoch4------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0346+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9999-0.j, -0.0173-0.j],
        [ 0.0173+0.j,  0.9999-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5264-0.5622j, 0.4521+0.4500j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5842+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7024-0.7118j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7024+0.7118j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5264-0.5622j, 0.4521+0.4500j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0304-0.7696j, -0.0028+0.6378j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5932, 0.4068]], grad_fn=<PowBackward0>)
loss:  0.5222799777984619
loss:  0.7215071320533752
loss:  1.1823053359985352
loss:  0.5702562928199768
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.0362+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0181-0.j],
        [ 0.0181+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2434-0.2236j, 0.7303+0.5978j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5823+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7030-0.7112j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7030+0.7112j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2434-0.2236j, 0.7303+0.5978j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0121-0.3303j, 0.0882+0.9397j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1093, 0.8907]], grad_fn=<PowBackward0>)
loss:  0.11570413410663605
loss:  0.7825016379356384
loss:  0.45335254073143005
loss:  0.5153481364250183
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.0378+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0189-0.j],
        [ 0.0189+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6342-0.5801j, 0.3916+0.3285j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5805+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7037-0.7105j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7037+0.7105j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6342-0.5801j, 0.3916+0.3285j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0341-0.8588j, 0.0421+0.5094j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7387, 0.2613]], grad_fn=<PowBackward0>)
loss:  0.30282583832740784
loss:  0.35252639651298523
loss:  0.15649597346782684
loss:  0.7839105129241943
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0391+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0196-0.j],
        [ 0.0196+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7206-0.6058j, 0.2707+0.2009j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5787+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7043-0.7099j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7043+0.7099j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7206-0.6058j, 0.2707+0.2009j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0775-0.9382j, 0.0480+0.3337j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8863, 0.1137]], grad_fn=<PowBackward0>)
loss:  0.12068280577659607
loss:  0.7113578915596008
loss:  0.2043980211019516
loss:  0.25557130575180054
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0403+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0201-0.j],
        [ 0.0201+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3703-0.2824j, 0.7277+0.5036j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5768+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7050-0.7092j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7050+0.7092j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3703-0.2824j, 0.7277+0.5036j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0608-0.4617j, 0.1558+0.8711j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2169, 0.7831]], grad_fn=<PowBackward0>)
loss:  0.24445247650146484
loss:  0.34484127163887024
loss:  0.4365137815475464
loss:  0.19717919826507568
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0413+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0207-0.j],
        [ 0.0207+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7753-0.5995j, 0.1688+0.1048j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5750+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7056-0.7086j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7056+0.7086j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7753-0.5995j, 0.1688+0.1048j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1223-0.9724j, 0.0449+0.1935j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9605, 0.0395]], grad_fn=<PowBackward0>)
loss:  0.04025407135486603
loss:  0.3894886076450348
loss:  0.454524427652359
loss:  0.2994706630706787
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.0423+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0211-0.j],
        [ 0.0211+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8046-0.3432j, 0.4522+0.1742j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5732+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7063-0.7079j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7063+0.7079j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8046-0.3432j, 0.4522+0.1742j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3253-0.8120j, 0.1960+0.4432j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7652, 0.2348]], grad_fn=<PowBackward0>)
loss:  1.448846697807312
loss:  0.6402149200439453
loss:  0.2559092342853546
loss:  0.5694108605384827
----------index28----------
train inputs:  tensor([[1.6821, 2.0731]], 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.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([[2.0731]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.0731+0.j]])
rz_matrix:  tensor([[0.5092-0.8607j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5092+0.8607j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0436+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9998-0.j, -0.0218-0.j],
        [ 0.0218+0.j,  0.9998-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3311-0.5876j, 0.3868+0.6288j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5713+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7069-0.7073j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7069+0.7073j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3311-0.5876j, 0.3868+0.6288j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1816-0.6496j, -0.1713+0.7181j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4549, 0.5451]], grad_fn=<PowBackward0>)
loss:  0.7876139283180237
loss:  0.3976805806159973
loss:  1.2769050598144531
loss:  0.8838256001472473
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.0452+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0226-0.j],
        [ 0.0226+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9012-0.3227j, 0.2770+0.0835j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5695+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7076-0.7066j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7076+0.7066j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9012-0.3227j, 0.2770+0.0835j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4096-0.8652j, 0.1371+0.2548j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9163, 0.0837]], grad_fn=<PowBackward0>)
loss:  0.0874258354306221
loss:  0.6327160000801086
loss:  0.40212389826774597
loss:  0.34173583984375
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.0467+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0233-0.j],
        [ 0.0233+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5746-0.4250j, 0.5801+0.3908j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5677+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7082-0.7060j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7082+0.7060j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5746-0.4250j, 0.5801+0.3908j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1069-0.7066j, 0.1349+0.6863j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5107, 0.4893]], grad_fn=<PowBackward0>)
loss:  0.714830219745636
loss:  0.0413527637720108
loss:  0.5075580477714539
loss:  0.278779536485672
----------index40----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0480+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0240-0.j],
        [ 0.0240+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5367-0.4327j, 0.5844+0.4280j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5658+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7089-0.7053j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7089+0.7053j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5367-0.4327j, 0.5844+0.4280j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0753-0.6853j, 0.1124+0.7156j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4753, 0.5247]], grad_fn=<PowBackward0>)
loss:  0.6449066996574402
loss:  0.20439261198043823
loss:  0.0005907969316467643
loss:  0.3412307798862457
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0491+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0246-0.j],
        [ 0.0246+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6483-0.6846j, 0.2473+0.2233j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5640+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7095-0.7047j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7095+0.7047j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6483-0.6846j, 0.2473+0.2233j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0224-0.9426j,  0.0181+0.3327j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8890, 0.1110]], grad_fn=<PowBackward0>)
loss:  0.11766776442527771
loss:  0.3916553258895874
loss:  0.12027084827423096
loss:  0.582976222038269
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.0500+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0250-0.j],
        [ 0.0250+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6104-0.6058j, 0.3820+0.3383j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5622+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7101-0.7041j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7101+0.7041j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6104-0.6058j, 0.3820+0.3383j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0069-0.8600j, 0.0331+0.5092j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7396, 0.2604]], grad_fn=<PowBackward0>)
loss:  0.3016064465045929
loss:  0.03652476519346237
loss:  0.3082636296749115
loss:  0.3939654231071472
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.0506+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0253-0.j],
        [ 0.0253+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6901-0.5438j, 0.3916+0.2732j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5603+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7108-0.7034j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7108+0.7034j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6901-0.5438j, 0.3916+0.2732j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1080-0.8720j, 0.0862+0.4697j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7720, 0.2280]], grad_fn=<PowBackward0>)
loss:  0.25880491733551025
loss:  0.3481225371360779
loss:  0.40445849299430847
loss:  0.46433591842651367
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.0510+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0255-0.j],
        [ 0.0255+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6804-0.6216j, 0.3043+0.2408j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5585+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7114-0.7028j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7114+0.7028j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6804-0.6216j, 0.3043+0.2408j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0472-0.9204j, 0.0472+0.3852j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8494, 0.1506]], grad_fn=<PowBackward0>)
loss:  0.16324283182621002
loss:  0.16324718296527863
loss:  0.5063523650169373
loss:  0.32389792799949646
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0513+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0256-0.j],
        [ 0.0256+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.7989-0.2911j, 0.5007+0.1623j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5567+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7121-0.7021j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7121+0.7021j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7989-0.2911j, 0.5007+0.1623j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3644-0.7682j, 0.2426+0.4671j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7230, 0.2770]], grad_fn=<PowBackward0>)
loss:  1.283570647239685
loss:  0.114995077252388
loss:  0.34065109491348267
loss:  0.5657798051834106
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.0523+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9997-0.j, -0.0261-0.j],
        [ 0.0261+0.j,  0.9997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.2945-0.2361j, 0.7615+0.5269j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5549+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7127-0.7015j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7127+0.7015j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2945-0.2361j, 0.7615+0.5269j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0443-0.3748j, 0.1732+0.9097j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1424, 0.8576]], grad_fn=<PowBackward0>)
loss:  0.1536673605442047
loss:  0.29710710048675537
loss:  0.2994016110897064
loss:  0.0007006595842540264
----------index68----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0531+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0266-0.j],
        [ 0.0266+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6893-0.4234j, 0.5154+0.2828j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5530+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7134-0.7008j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7134+0.7008j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6893-0.4234j, 0.5154+0.2828j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1950-0.7851j, 0.1694+0.5629j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6544, 0.3456]], grad_fn=<PowBackward0>)
loss:  1.062418818473816
--------------------Validation--------------------
valid set accuracy: 0.7931034564971924
valid set loss: 0.4313473105430603
------------------------------Epoch5------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0534+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0267-0.j],
        [ 0.0267+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6478-0.6851j, 0.2487+0.2218j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5526+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7135-0.7006j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7135+0.7006j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6478-0.6851j, 0.2487+0.2218j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0178-0.9427j,  0.0220+0.3325j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8890, 0.1110]], grad_fn=<PowBackward0>)
loss:  0.117707259953022
loss:  0.16342024505138397
loss:  1.280444860458374
loss:  0.5614498257637024
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.0543+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0272-0.j],
        [ 0.0272+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5561-0.3496j, 0.6569+0.3702j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5509+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7141-0.7000j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7141+0.7000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5561-0.3496j, 0.6569+0.3702j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1524-0.6390j, 0.2100+0.7241j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4315, 0.5685]], grad_fn=<PowBackward0>)
loss:  0.5648117661476135
loss:  0.7039000391960144
loss:  1.2597877979278564
loss:  0.5049310326576233
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.0559+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0280-0.j],
        [ 0.0280+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5010-0.1545j, 0.8215+0.2241j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5491+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7147-0.6994j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7147+0.6994j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5010-0.1545j, 0.8215+0.2241j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2501-0.4608j, 0.4305+0.7347j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2749, 0.7251]], grad_fn=<PowBackward0>)
loss:  0.3214143216609955
loss:  0.6349578499794006
loss:  0.19444164633750916
loss:  0.16367575526237488
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0576+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0288-0.j],
        [ 0.0288+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5212-0.5673j, 0.4581+0.4435j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5474+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7153-0.6988j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7153+0.6988j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5212-0.5673j, 0.4581+0.4435j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0236-0.7700j,  0.0178+0.6373j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5935, 0.4065]], grad_fn=<PowBackward0>)
loss:  0.5217401385307312
loss:  0.6424708962440491
loss:  0.3832525312900543
loss:  0.2993793189525604
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0589+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9996-0.j, -0.0295-0.j],
        [ 0.0295+0.j,  0.9996-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6679-0.5715j, 0.3827+0.2842j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5456+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7159-0.6982j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7159+0.6982j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6679-0.5715j, 0.3827+0.2842j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0792-0.8755j, 0.0756+0.4707j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7728, 0.2272]], grad_fn=<PowBackward0>)
loss:  0.25778526067733765
loss:  0.42504850029945374
loss:  0.1546613574028015
loss:  0.12248619645833969
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0600+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0300-0.j],
        [ 0.0300+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2347-0.2307j, 0.7331+0.5951j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5439+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7166-0.6975j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7166+0.6975j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2347-0.2307j, 0.7331+0.5951j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0072-0.3290j, 0.1102+0.9378j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1083, 0.8917]], grad_fn=<PowBackward0>)
loss:  0.11464875191450119
loss:  1.1584519147872925
loss:  0.404339462518692
loss:  0.7688278555870056
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.0611+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0305-0.j],
        [ 0.0305+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4876-0.4026j, 0.6260+0.4564j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5422+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7172-0.6969j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7172+0.6969j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4876-0.4026j, 0.6260+0.4564j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0691-0.6285j, 0.1309+0.7636j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3998, 0.6002]], grad_fn=<PowBackward0>)
loss:  0.5104941129684448
loss:  0.2993726432323456
loss:  0.04269616678357124
loss:  0.2726377248764038
----------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  ry
ry_matrix theta:  tensor([[0.0622+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0311-0.j],
        [ 0.0311+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6878-0.5454j, 0.3956+0.2701j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5404+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7178-0.6963j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7178+0.6963j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6878-0.5454j, 0.3956+0.2701j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1140-0.8704j, 0.0959+0.4693j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7705, 0.2295]], grad_fn=<PowBackward0>)
loss:  0.26065751910209656
loss:  1.0561070442199707
loss:  0.2966329753398895
loss:  0.5612753033638
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.0631+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0316-0.j],
        [ 0.0316+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4826-0.5710j, 0.4599+0.4791j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5387+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7184-0.6957j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7184+0.6957j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4826-0.5710j, 0.4599+0.4791j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0505-0.7459j, -0.0029+0.6641j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5589, 0.4411]], grad_fn=<PowBackward0>)
loss:  0.5817332863807678
loss:  0.7091363668441772
loss:  0.5023012161254883
loss:  0.304977685213089
----------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  ry
ry_matrix theta:  tensor([[0.0641+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0321-0.j],
        [ 0.0321+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4498-0.3483j, 0.6814+0.4605j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5369+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7190-0.6950j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7190+0.6950j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4498-0.3483j, 0.6814+0.4605j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0813-0.5630j, 0.1699+0.8047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3236, 0.6764]], grad_fn=<PowBackward0>)
loss:  0.3909785747528076
loss:  0.46487942337989807
loss:  0.3942219316959381
loss:  0.8774417638778687
----------index40----------
train inputs:  tensor([[1.6821, 2.0731]], 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.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([[2.0731]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.0731+0.j]])
rz_matrix:  tensor([[0.5092-0.8607j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5092+0.8607j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0650+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0325-0.j],
        [ 0.0325+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3269-0.5943j, 0.3903+0.6225j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5352+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7196-0.6944j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7196+0.6944j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3269-0.5943j, 0.3903+0.6225j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1774-0.6547j, -0.1514+0.7190j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4601, 0.5399]], grad_fn=<PowBackward0>)
loss:  0.776321291923523
loss:  0.25855109095573425
loss:  0.0924476757645607
loss:  0.30224183201789856
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0657+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0329-0.j],
        [ 0.0329+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5908-0.5942j, 0.4116+0.3584j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5335+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7202-0.6938j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7202+0.6938j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5908-0.5942j, 0.4116+0.3584j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0133-0.8378j, 0.0478+0.5437j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7022, 0.2978]], grad_fn=<PowBackward0>)
loss:  0.3536039888858795
loss:  0.1521240770816803
loss:  0.3871845006942749
loss:  0.24038344621658325
----------index48----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0663+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9995-0.j, -0.0331-0.j],
        [ 0.0331+0.j,  0.9995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.5906-0.3382j, 0.6550+0.3284j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5318+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7208-0.6932j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7208+0.6932j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5906-0.3382j, 0.6550+0.3284j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1913-0.6531j, 0.2444+0.6907j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4631, 0.5369]], grad_fn=<PowBackward0>)
loss:  0.6220253705978394
loss:  0.7131006121635437
loss:  0.3377334773540497
loss:  0.3376959562301636
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.0670+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0335-0.j],
        [ 0.0335+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6669-0.2953j, 0.6380+0.2468j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5300+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7214-0.6925j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7214+0.6925j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6669-0.2953j, 0.6380+0.2468j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2766-0.6749j, 0.2893+0.6199j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5320, 0.4680]], grad_fn=<PowBackward0>)
loss:  0.7593196630477905
loss:  0.20448137819766998
loss:  0.33756521344184875
loss:  0.0011467353906482458
----------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  ry
ry_matrix theta:  tensor([[0.0679+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0340-0.j],
        [ 0.0340+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7930-0.6082j, 0.0269-0.0207j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5283+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7220-0.6919j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7220+0.6919j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7930-0.6082j, 0.0269-0.0207j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1517-0.9878j, 0.0337+0.0037j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9988, 0.0012]], grad_fn=<PowBackward0>)
loss:  0.0011535381199792027
loss:  0.1143476590514183
loss:  1.4154176712036133
loss:  0.44574105739593506
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0688+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0344-0.j],
        [ 0.0344+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.4988-0.6801j, 0.3486+0.4088j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5266+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7226-0.6913j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7226+0.6913j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4988-0.6801j, 0.3486+0.4088j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1097-0.8363j, -0.0307+0.5364j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7114, 0.2886]], grad_fn=<PowBackward0>)
loss:  0.3405737578868866
loss:  0.04240763932466507
loss:  0.12156127393245697
loss:  0.40062353014945984
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.0697+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0348-0.j],
        [ 0.0348+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4697-0.6461j, 0.3870+0.4607j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5248+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7232-0.6907j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7232+0.6907j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4697-0.6461j, 0.3870+0.4607j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1065-0.7916j, -0.0383+0.6004j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6380, 0.3620]], grad_fn=<PowBackward0>)
loss:  0.44936391711235046
loss:  0.20450463891029358
loss:  0.31170472502708435
loss:  0.347063809633255
----------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  ry
ry_matrix theta:  tensor([[0.0703+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0351-0.j],
        [ 0.0351+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1215-0.1448j, 0.7602+0.6216j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5231+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7238-0.6900j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7238+0.6900j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1215-0.1448j, 0.7602+0.6216j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0120-0.1886j,  0.1212+0.9745j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0357, 0.9643]], grad_fn=<PowBackward0>)
loss:  0.03637770190834999
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.427613765001297
------------------------------Epoch6------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0704+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0352-0.j],
        [ 0.0352+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4512-0.1797j, 0.8278+0.2807j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5227+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7239-0.6899j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7239+0.6899j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4512-0.1797j, 0.8278+0.2807j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2026-0.4414j, 0.4056+0.7743j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2359, 0.7641]], grad_fn=<PowBackward0>)
loss:  0.2690201699733734
loss:  0.5000905990600586
loss:  0.5580532550811768
loss:  0.49998268485069275
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.0711+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0355-0.j],
        [ 0.0355+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2306-0.2340j, 0.7344+0.5938j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5210+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7245-0.6893j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7245+0.6893j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2306-0.2340j, 0.7344+0.5938j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0058-0.3285j, 0.1227+0.9365j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1080, 0.8920]], grad_fn=<PowBackward0>)
loss:  0.11424355208873749
loss:  0.6194493770599365
loss:  0.3367941081523895
loss:  0.03637491911649704
----------index8----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8165+0.j, 0.5774+0.j]])
New state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0719+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9994-0.j, -0.0359-0.j],
        [ 0.0359+0.j,  0.9994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5301-0.6237j, 0.4042+0.4082j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5194+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7250-0.6887j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7250+0.6887j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5301-0.6237j, 0.4042+0.4082j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0451-0.8173j,  0.0120+0.5743j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6700, 0.3300]], grad_fn=<PowBackward0>)
loss:  0.40047958493232727
loss:  1.049505352973938
loss:  0.001307268743403256
loss:  1.2322388887405396
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0728+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0364-0.j],
        [ 0.0364+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6857-0.5468j, 0.3993+0.2672j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5178+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7256-0.6881j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7256+0.6881j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6857-0.5468j, 0.3993+0.2672j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1213-0.8686j, 0.1059+0.4686j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7692, 0.2308]], grad_fn=<PowBackward0>)
loss:  0.2624082565307617
loss:  0.33648064732551575
loss:  0.30581656098365784
loss:  0.09454686939716339
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0738+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0369-0.j],
        [ 0.0369+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5174-0.5709j, 0.4623+0.4388j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5162+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7262-0.6875j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7262+0.6875j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5174-0.5709j, 0.4623+0.4388j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0168-0.7703j,  0.0340+0.6365j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5937, 0.4063]], grad_fn=<PowBackward0>)
loss:  0.521410346031189
loss:  0.1512368619441986
loss:  0.312019407749176
loss:  0.3773662745952606
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0746+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0373-0.j],
        [ 0.0373+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6645-0.2963j, 0.6405+0.2457j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5145+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7267-0.6869j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7267+0.6869j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6645-0.2963j, 0.6405+0.2457j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2794-0.6718j, 0.2967+0.6186j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5293, 0.4707]], grad_fn=<PowBackward0>)
loss:  0.7536277770996094
loss:  0.556358814239502
loss:  0.15341584384441376
loss:  0.2389833927154541
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.0757+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0378-0.j],
        [ 0.0378+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4333-0.3699j, 0.6647+0.4833j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5129+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7273-0.6863j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7273+0.6863j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4333-0.3699j, 0.6647+0.4833j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0612-0.5664j, 0.1518+0.8077j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3246, 0.6754]], grad_fn=<PowBackward0>)
loss:  0.39240971207618713
loss:  0.29937899112701416
loss:  0.8737998008728027
loss:  0.2993803024291992
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.0766+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0383-0.j],
        [ 0.0383+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6645-0.5740j, 0.3886+0.2791j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5113+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7278-0.6858j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7278+0.6858j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6645-0.5740j, 0.3886+0.2791j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0900-0.8735j, 0.0914+0.4696j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7711, 0.2289]], grad_fn=<PowBackward0>)
loss:  0.25996822118759155
loss:  0.19113729894161224
loss:  0.04420420899987221
loss:  0.12414044886827469
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.0772+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9993-0.j, -0.0386-0.j],
        [ 0.0386+0.j,  0.9993-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6491-0.3316j, 0.6273+0.2743j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5097+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7284-0.6852j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7284+0.6852j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6491-0.3316j, 0.6273+0.2743j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2456-0.6863j, 0.2690+0.6296j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5313, 0.4687]], grad_fn=<PowBackward0>)
loss:  0.7577314376831055
loss:  0.7698204517364502
loss:  0.3466930687427521
loss:  1.1418037414550781
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.0780+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9992-0.j, -0.0390-0.j],
        [ 0.0390+0.j,  0.9992-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6667-0.5355j, 0.4304+0.2892j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5080+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7289-0.6846j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7289+0.6846j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6667-0.5355j, 0.4304+0.2892j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1194-0.8467j, 0.1157+0.5054j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7312, 0.2688]], grad_fn=<PowBackward0>)
loss:  0.3131324350833893
loss:  0.3028152585029602
loss:  0.3879181444644928
loss:  0.001546624582260847
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.0788+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9992-0.j, -0.0394-0.j],
        [ 0.0394+0.j,  0.9992-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.7962-0.3463j, 0.4668+0.1679j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5064+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7295-0.6840j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7295+0.6840j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7962-0.3463j, 0.4668+0.1679j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3439-0.7972j, 0.2257+0.4418j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7539, 0.2461]], grad_fn=<PowBackward0>)
loss:  1.4019347429275513
loss:  0.6373395323753357
loss:  1.2481108903884888
loss:  0.33521705865859985
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0801+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9992-0.j, -0.0400-0.j],
        [ 0.0400+0.j,  0.9992-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6759-0.6251j, 0.3142+0.2318j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5048+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7301-0.6834j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7301+0.6834j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6759-0.6251j, 0.3142+0.2318j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0663-0.9182j, 0.0710+0.3839j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8476, 0.1524]], grad_fn=<PowBackward0>)
loss:  0.1653881072998047
loss:  0.0433947816491127
loss:  0.35428112745285034
loss:  0.6911664605140686
----------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  ry
ry_matrix theta:  tensor([[0.0812+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9992-0.j, -0.0406-0.j],
        [ 0.0406+0.j,  0.9992-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.4967-0.6826j, 0.3517+0.4045j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5032+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7306-0.6828j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7306+0.6828j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4967-0.6826j, 0.3517+0.4045j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1032-0.8378j, -0.0193+0.5357j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7126, 0.2874]], grad_fn=<PowBackward0>)
loss:  0.3387865126132965
loss:  0.41148126125335693
loss:  0.44263917207717896
loss:  0.40416067838668823
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.0823+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9992-0.j, -0.0411-0.j],
        [ 0.0411+0.j,  0.9992-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6756-0.6253j, 0.3149+0.2311j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.5015+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7312-0.6822j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7312+0.6822j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6756-0.6253j, 0.3149+0.2311j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0673-0.9181j, 0.0726+0.3838j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8474, 0.1526]], grad_fn=<PowBackward0>)
loss:  0.16556105017662048
loss:  0.5479857921600342
loss:  0.11387632042169571
loss:  0.506119966506958
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.0832+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0416-0.j],
        [ 0.0416+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5565-0.3937j, 0.6277+0.3759j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4999+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7317-0.6816j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7317+0.6816j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5565-0.3937j, 0.6277+0.3759j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1388-0.6674j, 0.2031+0.7029j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4646, 0.5354]], grad_fn=<PowBackward0>)
loss:  0.6248016357421875
loss:  0.4657110273838043
loss:  0.5798662900924683
loss:  0.4468236267566681
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0840+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0420-0.j],
        [ 0.0420+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5636-0.4322j, 0.5908+0.3828j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4983+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7323-0.6810j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7323+0.6810j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5636-0.4322j, 0.5908+0.3828j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1184-0.7003j, 0.1719+0.6826j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5045, 0.4955]], grad_fn=<PowBackward0>)
loss:  0.7021389603614807
loss:  0.2957361042499542
loss:  0.11823709309101105
loss:  0.2610021233558655
----------index64----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.0847+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0424-0.j],
        [ 0.0424+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6131-0.6625j, 0.3249+0.2821j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4967+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7328-0.6804j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7328+0.6804j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6131-0.6625j, 0.3249+0.2821j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0015-0.9027j,  0.0461+0.4277j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8149, 0.1851]], grad_fn=<PowBackward0>)
loss:  0.20468631386756897
loss:  0.2046882063150406
loss:  0.708173930644989
loss:  0.3821566700935364
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.0852+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0426-0.j],
        [ 0.0426+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6915-0.6374j, 0.2782+0.1952j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4951+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7334-0.6798j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7334+0.6798j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6915-0.6374j, 0.2782+0.1952j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0738-0.9376j, 0.0713+0.3323j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8845, 0.1155]], grad_fn=<PowBackward0>)
loss:  0.12272855639457703
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.4244270920753479
------------------------------Epoch7------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0854+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0427-0.j],
        [ 0.0427+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6035-0.6117j, 0.3928+0.3275j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4947+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7335-0.6797j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7335+0.6797j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6035-0.6117j, 0.3928+0.3275j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0269-0.8589j, 0.0655+0.5072j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7385, 0.2615]], grad_fn=<PowBackward0>)
loss:  0.30316081643104553
loss:  0.15265101194381714
loss:  0.4953474700450897
loss:  0.7015825510025024
----------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  ry
ry_matrix theta:  tensor([[0.0858+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0429-0.j],
        [ 0.0429+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4299-0.3724j, 0.6669+0.4814j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4932+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7340-0.6791j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7340+0.6791j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4299-0.3724j, 0.6669+0.4814j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0627-0.5653j, 0.1626+0.8063j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3235, 0.6765]], grad_fn=<PowBackward0>)
loss:  0.39078307151794434
loss:  1.2114626169204712
loss:  1.0398917198181152
loss:  0.30702245235443115
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.0868+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9991-0.j, -0.0434-0.j],
        [ 0.0434+0.j,  0.9991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3394-0.3789j, 0.6351+0.5813j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4917+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7345-0.6786j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7345+0.6786j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3394-0.3789j, 0.6351+0.5813j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0078-0.5086j,  0.0720+0.8579j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2588, 0.7412]], grad_fn=<PowBackward0>)
loss:  0.2994285225868225
loss:  0.3338542580604553
loss:  0.7509652376174927
loss:  0.2618796229362488
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.0878+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0439-0.j],
        [ 0.0439+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7138-0.6105j, 0.2882+0.1862j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4902+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7350-0.6780j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7350+0.6780j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7138-0.6105j, 0.2882+0.1862j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1107-0.9328j, 0.0856+0.3322j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8823, 0.1177]], grad_fn=<PowBackward0>)
loss:  0.12523433566093445
loss:  0.33782321214675903
loss:  0.5050767064094543
loss:  0.4410732388496399
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.0887+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0443-0.j],
        [ 0.0443+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5267-0.6271j, 0.4087+0.4029j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4887+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7355-0.6775j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7355+0.6775j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5267-0.6271j, 0.4087+0.4029j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0374-0.8181j,  0.0276+0.5732j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6707, 0.3293]], grad_fn=<PowBackward0>)
loss:  0.39950600266456604
loss:  0.16610510647296906
loss:  0.26159045100212097
loss:  0.5211352109909058
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.0894+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0447-0.j],
        [ 0.0447+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5580-0.3297j, 0.6830+0.3370j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4872+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7360-0.6769j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7360+0.6769j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5580-0.3297j, 0.6830+0.3370j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1876-0.6204j, 0.2746+0.7103j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4200, 0.5800]], grad_fn=<PowBackward0>)
loss:  0.5447709560394287
loss:  0.09871147572994232
loss:  0.03642060235142708
loss:  0.37182164192199707
----------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  ry
ry_matrix theta:  tensor([[0.0899+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0449-0.j],
        [ 0.0449+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5543-0.3949j, 0.6296+0.3746j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4857+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7366-0.6764j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7366+0.6764j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5543-0.3949j, 0.6296+0.3746j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1412-0.6658j, 0.2104+0.7018j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4633, 0.5367]], grad_fn=<PowBackward0>)
loss:  0.6222729086875916
loss:  0.12310444563627243
loss:  0.8692647218704224
loss:  0.23679961264133453
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.0905+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0452-0.j],
        [ 0.0452+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5505-0.1752j, 0.7892+0.2082j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4842+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7371-0.6758j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7371+0.6758j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5505-0.1752j, 0.7892+0.2082j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2873-0.5012j, 0.4410+0.6869j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3337, 0.6663]], grad_fn=<PowBackward0>)
loss:  0.4060448706150055
loss:  0.333163857460022
loss:  1.386603832244873
loss:  0.6093282103538513
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.0915+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9990-0.j, -0.0457-0.j],
        [ 0.0457+0.j,  0.9990-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6637-0.5374j, 0.4348+0.2856j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4827+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7376-0.6753j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7376+0.6753j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6637-0.5374j, 0.4348+0.2856j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1267-0.8446j, 0.1279+0.5043j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7294, 0.2706]], grad_fn=<PowBackward0>)
loss:  0.31559497117996216
loss:  0.7622910737991333
loss:  0.38036835193634033
loss:  0.6341632008552551
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.0926+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9989-0.j, -0.0463-0.j],
        [ 0.0463+0.j,  0.9989-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4123-0.3363j, 0.7048+0.4693j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4812+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7381-0.6747j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7381+0.6747j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4123-0.3363j, 0.7048+0.4693j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0774-0.5264j, 0.2036+0.8219j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2831, 0.7169]], grad_fn=<PowBackward0>)
loss:  0.33281710743904114
loss:  0.445229709148407
loss:  0.3548910617828369
loss:  0.7059652209281921
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.0935+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9989-0.j, -0.0468-0.j],
        [ 0.0468+0.j,  0.9989-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.5912-0.3828j, 0.6255+0.3358j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4797+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7386-0.6742j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7386+0.6742j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5912-0.3828j, 0.6255+0.3358j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1786-0.6812j, 0.2356+0.6697j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4960, 0.5040]], grad_fn=<PowBackward0>)
loss:  0.6851159334182739
loss:  0.5486727952957153
loss:  0.14917664229869843
loss:  0.1135709211230278
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.0945+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9989-0.j, -0.0472-0.j],
        [ 0.0472+0.j,  0.9989-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4754-0.5784j, 0.4674+0.4701j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4782+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7391-0.6736j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7391+0.6736j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4754-0.5784j, 0.4674+0.4701j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0383-0.7477j,  0.0288+0.6623j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5605, 0.4395]], grad_fn=<PowBackward0>)
loss:  0.5788940787315369
loss:  0.7386354804039001
loss:  0.0022560753859579563
loss:  0.2624029219150543
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.0954+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9989-0.j, -0.0477-0.j],
        [ 0.0477+0.j,  0.9989-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.3956-0.4650j, 0.5701+0.5498j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4767+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7396-0.6731j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7396+0.6731j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3956-0.4650j, 0.5701+0.5498j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0204-0.6101j,  0.0516+0.7904j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3727, 0.6273]], grad_fn=<PowBackward0>)
loss:  0.4662722051143646
loss:  0.11853010207414627
loss:  0.11353733390569687
loss:  0.34584179520606995
----------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  ry
ry_matrix theta:  tensor([[0.0960+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0480-0.j],
        [ 0.0480+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4019-0.6707j, 0.3671+0.5038j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4752+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7401-0.6725j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7401+0.6725j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4019-0.6707j, 0.3671+0.5038j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1536-0.7666j, -0.0671+0.6198j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6114, 0.3886]], grad_fn=<PowBackward0>)
loss:  0.49208498001098633
loss:  0.002310917479917407
loss:  0.18805833160877228
loss:  1.1242130994796753
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.0966+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0483-0.j],
        [ 0.0483+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6112-0.6642j, 0.3285+0.2781j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4737+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7406-0.6720j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7406+0.6720j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6112-0.6642j, 0.3285+0.2781j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0063-0.9026j, 0.0564+0.4267j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8147, 0.1853]], grad_fn=<PowBackward0>)
loss:  0.20489230751991272
loss:  0.046342022716999054
loss:  0.29950958490371704
loss:  0.04495568573474884
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.0972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0486-0.j],
        [ 0.0486+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.7872-0.2948j, 0.5189+0.1556j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4722+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7411-0.6714j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7411+0.6714j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7872-0.2948j, 0.5189+0.1556j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3854-0.7470j, 0.2801+0.4637j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7065, 0.2935]], grad_fn=<PowBackward0>)
loss:  1.2260081768035889
loss:  0.4041040539741516
loss:  0.2666315734386444
loss:  0.20491549372673035
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.0979+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0489-0.j],
        [ 0.0489+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4382-0.3560j, 0.6889+0.4545j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4707+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7416-0.6708j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7416+0.6708j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4382-0.3560j, 0.6889+0.4545j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0862-0.5580j, 0.2060+0.7992j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3188, 0.6812]], grad_fn=<PowBackward0>)
loss:  0.3838620185852051
loss:  0.2952430248260498
loss:  0.5469062924385071
loss:  0.1669084131717682
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.0985+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0492-0.j],
        [ 0.0492+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4834-0.1592j, 0.8320+0.2207j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4692+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7421-0.6703j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7421+0.6703j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4834-0.1592j, 0.8320+0.2207j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2520-0.4422j, 0.4695+0.7215j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2590, 0.7410]], grad_fn=<PowBackward0>)
loss:  0.2998129725456238
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.42165982723236084
------------------------------Epoch8------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.0986+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0493-0.j],
        [ 0.0493+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5791-0.6371j, 0.3823+0.3356j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4688+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7422-0.6702j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7422+0.6702j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5791-0.6371j, 0.3823+0.3356j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0029-0.8609j, 0.0588+0.5053j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7412, 0.2588]], grad_fn=<PowBackward0>)
loss:  0.29952672123908997
loss:  0.7045183777809143
loss:  0.2995296120643616
loss:  0.1876285970211029
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.0992+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0496-0.j],
        [ 0.0496+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5546-0.3313j, 0.6857+0.3354j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4675+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7427-0.6696j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7427+0.6696j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5546-0.3313j, 0.6857+0.3354j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1901-0.6175j, 0.2847+0.7082j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4174, 0.5826]], grad_fn=<PowBackward0>)
loss:  0.540219247341156
loss:  0.5784659385681152
loss:  0.6822627186775208
loss:  0.3784064054489136
----------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  ry
ry_matrix theta:  tensor([[0.0999+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9988-0.j, -0.0499-0.j],
        [ 0.0499+0.j,  0.9988-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6007-0.6141j, 0.3971+0.3231j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4661+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7431-0.6691j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7431+0.6691j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6007-0.6141j, 0.3971+0.3231j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0355-0.8583j, 0.0789+0.5058j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7379, 0.2621]], grad_fn=<PowBackward0>)
loss:  0.3039155900478363
loss:  0.4384184181690216
loss:  0.0025105969980359077
loss:  1.030281662940979
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1005+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9987-0.j, -0.0502-0.j],
        [ 0.0502+0.j,  0.9987-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.4932-0.6865j, 0.3565+0.3979j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4647+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7436-0.6686j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7436+0.6686j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4932-0.6865j, 0.3565+0.3979j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0922-0.8403j, -0.0010+0.5343j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7146, 0.2854]], grad_fn=<PowBackward0>)
loss:  0.3360944390296936
loss:  0.3988548517227173
loss:  0.14851398766040802
loss:  0.23529385030269623
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1012+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9987-0.j, -0.0506-0.j],
        [ 0.0506+0.j,  0.9987-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5508-0.3970j, 0.6327+0.3724j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4634+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7441-0.6681j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7441+0.6681j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5508-0.3970j, 0.6327+0.3724j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1445-0.6634j, 0.2220+0.6998j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4610, 0.5390]], grad_fn=<PowBackward0>)
loss:  0.6180634498596191
loss:  1.2208318710327148
loss:  0.03653712943196297
loss:  0.741191565990448
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1021+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9987-0.j, -0.0510-0.j],
        [ 0.0510+0.j,  0.9987-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5403-0.3584j, 0.6700+0.3617j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4620+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7445-0.6676j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7445+0.6676j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5403-0.3584j, 0.6700+0.3617j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1630-0.6275j, 0.2573+0.7166j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4203, 0.5797]], grad_fn=<PowBackward0>)
loss:  0.5453172326087952
loss:  1.3720579147338867
loss:  0.2675449550151825
loss:  0.0026567671447992325
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1033+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9987-0.j, -0.0516-0.j],
        [ 0.0516+0.j,  0.9987-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5830-0.6008j, 0.4226+0.3471j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4606+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7450-0.6671j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7450+0.6671j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5830-0.6008j, 0.4226+0.3471j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0335-0.8365j, 0.0833+0.5405j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7009, 0.2991]], grad_fn=<PowBackward0>)
loss:  0.3554292321205139
loss:  0.16737154126167297
loss:  0.2552081048488617
loss:  0.113359734416008
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1042+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0521-0.j],
        [ 0.0521+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6413-0.6905j, 0.2651+0.2043j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4593+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7454-0.6666j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7454+0.6666j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6413-0.6905j, 0.2651+0.2043j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0177-0.9422j, 0.0614+0.3290j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8880, 0.1120]], grad_fn=<PowBackward0>)
loss:  0.11879466474056244
loss:  0.3087600767612457
loss:  0.4667198956012726
loss:  0.7313026785850525
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1049+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0524-0.j],
        [ 0.0524+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6608-0.5393j, 0.4393+0.2820j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4579+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7459-0.6661j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7459+0.6661j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6608-0.5393j, 0.4393+0.2820j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1337-0.8424j, 0.1398+0.5029j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7275, 0.2725]], grad_fn=<PowBackward0>)
loss:  0.31810322403907776
loss:  0.864484965801239
loss:  0.33051249384880066
loss:  0.26377710700035095
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1055+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0527-0.j],
        [ 0.0527+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4736-0.4126j, 0.6367+0.4474j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4565+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7463-0.6656j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7463+0.6656j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4736-0.4126j, 0.6367+0.4474j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0788-0.6231j, 0.1774+0.7576j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3945, 0.6055]], grad_fn=<PowBackward0>)
loss:  0.5017217993736267
loss:  0.12438206374645233
loss:  0.4890682101249695
loss:  0.6019535064697266
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1060+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0530-0.j],
        [ 0.0530+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7112-0.6122j, 0.2947+0.1806j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4552+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7468-0.6651j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7468+0.6651j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7112-0.6122j, 0.2947+0.1806j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1239-0.9302j, 0.1000+0.3308j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8805, 0.1195]], grad_fn=<PowBackward0>)
loss:  0.12721049785614014
loss:  0.2050981968641281
loss:  0.36599966883659363
loss:  0.4888554513454437
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1066+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0533-0.j],
        [ 0.0533+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5391-0.6460j, 0.3922+0.3718j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4538+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7472-0.6646j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7472+0.6646j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5391-0.6460j, 0.3922+0.3718j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0264-0.8410j,  0.0459+0.5385j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7079, 0.2921]], grad_fn=<PowBackward0>)
loss:  0.3453899025917053
loss:  0.7545160055160522
loss:  0.33020487427711487
loss:  0.40409889817237854
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1072+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0536-0.j],
        [ 0.0536+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.8922-0.3251j, 0.3048+0.0734j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4524+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7477-0.6640j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7477+0.6640j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8922-0.3251j, 0.3048+0.0734j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4511-0.8356j, 0.1792+0.2573j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9017, 0.0983]], grad_fn=<PowBackward0>)
loss:  0.10348521918058395
loss:  0.11329738795757294
loss:  0.16771750152111053
loss:  1.113773226737976
----------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  ry
ry_matrix theta:  tensor([[0.1077+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9986-0.j, -0.0538-0.j],
        [ 0.0538+0.j,  0.9986-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5096-0.5782j, 0.4710+0.4291j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4511+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7481-0.6635j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7481+0.6635j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5096-0.5782j, 0.4710+0.4291j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0025-0.7707j,  0.0676+0.6336j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5940, 0.4060]], grad_fn=<PowBackward0>)
loss:  0.5208559036254883
loss:  0.15115033090114594
loss:  1.178081750869751
loss:  0.3955809772014618
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1085+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9985-0.j, -0.0542-0.j],
        [ 0.0542+0.j,  0.9985-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7915-0.5717j, 0.2003+0.0802j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4497+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7486-0.6630j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7486+0.6630j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7915-0.5717j, 0.2003+0.0802j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2135-0.9528j, 0.0968+0.1929j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9534, 0.0466]], grad_fn=<PowBackward0>)
loss:  0.04769127443432808
loss:  0.3872201442718506
loss:  0.5425987243652344
loss:  0.6936718821525574
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1094+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9985-0.j, -0.0547-0.j],
        [ 0.0547+0.j,  0.9985-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4619-0.6551j, 0.3962+0.4478j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4484+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7490-0.6625j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7490+0.6625j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4619-0.6551j, 0.3962+0.4478j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0880-0.7967j,  0.0001+0.5979j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6425, 0.3575]], grad_fn=<PowBackward0>)
loss:  0.44234907627105713
loss:  0.29430994391441345
loss:  0.38141292333602905
loss:  0.04627946764230728
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1104+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9985-0.j, -0.0552-0.j],
        [ 0.0552+0.j,  0.9985-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4663-0.7084j, 0.3405+0.4060j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4470+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7495-0.6620j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7495+0.6620j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4663-0.7084j, 0.3405+0.4060j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1195-0.8396j, -0.0136+0.5297j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7192, 0.2808]], grad_fn=<PowBackward0>)
loss:  0.32957640290260315
loss:  0.2052055448293686
loss:  0.6297538876533508
loss:  0.2645564675331116
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1111+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9985-0.j, -0.0555-0.j],
        [ 0.0555+0.j,  0.9985-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5540-0.6616j, 0.3708+0.3433j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4456+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7499-0.6615j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7499+0.6615j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5540-0.6616j, 0.3708+0.3433j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0221-0.8627j,  0.0510+0.5027j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7447, 0.2553]], grad_fn=<PowBackward0>)
loss:  0.294834166765213
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4190880358219147
------------------------------Epoch9------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1112+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9985-0.j, -0.0556-0.j],
        [ 0.0556+0.j,  0.9985-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3443-0.3001j, 0.7404+0.4933j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4453+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7501-0.6614j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7501+0.6614j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3443-0.3001j, 0.7404+0.4933j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0598-0.4527j, 0.2291+0.8596j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2086, 0.7914]], grad_fn=<PowBackward0>)
loss:  0.2338951677083969
loss:  0.5991933941841125
loss:  0.29482191801071167
loss:  0.3293438255786896
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1118+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9984-0.j, -0.0559-0.j],
        [ 0.0559+0.j,  0.9984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3181-0.2613j, 0.7762+0.4775j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4441+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7505-0.6609j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7505+0.6609j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3181-0.2613j, 0.7762+0.4775j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0660-0.4064j, 0.2669+0.8714j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1695, 0.8305]], grad_fn=<PowBackward0>)
loss:  0.18572023510932922
loss:  0.03669299557805061
loss:  0.7010093927383423
loss:  0.2996947467327118
----------index8----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1123+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9984-0.j, -0.0561-0.j],
        [ 0.0561+0.j,  0.9984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2155-0.2462j, 0.7390+0.5889j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4428+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7509-0.6605j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7509+0.6605j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2155-0.2462j, 0.7390+0.5889j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0008-0.3272j,  0.1660+0.9303j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1070, 0.8930]], grad_fn=<PowBackward0>)
loss:  0.11321187764406204
loss:  0.3982551693916321
loss:  0.363815575838089
loss:  0.3929734230041504
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1128+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9984-0.j, -0.0564-0.j],
        [ 0.0564+0.j,  0.9984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6707-0.6288j, 0.3252+0.2215j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4416+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7513-0.6600j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7513+0.6600j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6707-0.6288j, 0.3252+0.2215j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0889-0.9150j, 0.0981+0.3810j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8452, 0.1548]], grad_fn=<PowBackward0>)
loss:  0.1682136505842209
loss:  0.12502236664295197
loss:  1.1704578399658203
loss:  0.540878415107727
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1135+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9984-0.j, -0.0567-0.j],
        [ 0.0567+0.j,  0.9984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4328-0.3595j, 0.6923+0.4517j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4404+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7517-0.6595j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7517+0.6595j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4328-0.3595j, 0.6923+0.4517j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0882-0.5557j, 0.2225+0.7962j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3166, 0.6834]], grad_fn=<PowBackward0>)
loss:  0.380693644285202
loss:  0.7333515882492065
loss:  0.32893773913383484
loss:  0.10542001575231552
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.1144+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9984-0.j, -0.0572-0.j],
        [ 0.0572+0.j,  0.9984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5427-0.6107j, 0.4323+0.3815j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4392+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7521-0.6591j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7521+0.6591j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5427-0.6107j, 0.4323+0.3815j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0057-0.8170j, 0.0737+0.5718j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6676, 0.3324]], grad_fn=<PowBackward0>)
loss:  0.4041105806827545
loss:  0.12818646430969238
loss:  0.8613452911376953
loss:  0.046774208545684814
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1150+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0575-0.j],
        [ 0.0575+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6586-0.5407j, 0.4426+0.2793j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4380+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7525-0.6586j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7525+0.6586j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6586-0.5407j, 0.4426+0.2793j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1394-0.8406j, 0.1491+0.5016j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7261, 0.2739]], grad_fn=<PowBackward0>)
loss:  0.3200439214706421
loss:  1.3561420440673828
loss:  0.14718233048915863
loss:  0.15068461000919342
----------index28----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1156+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0578-0.j],
        [ 0.0578+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5804-0.6029j, 0.4262+0.3434j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4367+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7529-0.6582j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7529+0.6582j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5804-0.6029j, 0.4262+0.3434j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0401-0.8359j, 0.0948+0.5391j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7004, 0.2996]], grad_fn=<PowBackward0>)
loss:  0.3561139702796936
loss:  0.11919970065355301
loss:  0.441242516040802
loss:  0.2699292302131653
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1161+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0580-0.j],
        [ 0.0580+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4198-0.3796j, 0.6734+0.4757j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4355+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7533-0.6577j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7533+0.6577j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4198-0.3796j, 0.6734+0.4757j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0665-0.5620j, 0.1944+0.8012j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3203, 0.6797]], grad_fn=<PowBackward0>)
loss:  0.3860977590084076
loss:  0.5324019193649292
loss:  0.30485689640045166
loss:  0.539602518081665
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1166+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0583-0.j],
        [ 0.0583+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3299-0.3875j, 0.6401+0.5756j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4343+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7537-0.6572j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7537+0.6572j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3299-0.3875j, 0.6401+0.5756j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0060-0.5089j,  0.1041+0.8545j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2590, 0.7410]], grad_fn=<PowBackward0>)
loss:  0.29976245760917664
loss:  0.7493323087692261
loss:  0.0034158090129494667
loss:  0.4995097219944
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1171+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0585-0.j],
        [ 0.0585+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6724-0.4322j, 0.5372+0.2691j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4331+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7541-0.6568j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7541+0.6568j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6724-0.4322j, 0.5372+0.2691j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2232-0.7676j, 0.2283+0.5558j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6390, 0.3610]], grad_fn=<PowBackward0>)
loss:  1.0188888311386108
loss:  0.6120995283126831
loss:  0.2497093677520752
loss:  0.6736379861831665
----------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  ry
ry_matrix theta:  tensor([[0.1179+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9983-0.j, -0.0589-0.j],
        [ 0.0589+0.j,  0.9983-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4579-0.3777j, 0.6760+0.4366j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4318+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7545-0.6563j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7545+0.6563j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4579-0.3777j, 0.6760+0.4366j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0975-0.5855j, 0.2235+0.7731j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3523, 0.6477]], grad_fn=<PowBackward0>)
loss:  0.43438956141471863
loss:  0.20540498197078705
loss:  0.333727091550827
loss:  0.4674345850944519
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1186+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9982-0.j, -0.0593-0.j],
        [ 0.0593+0.j,  0.9982-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6562-0.5798j, 0.4025+0.2670j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4306+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7549-0.6559j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7549+0.6559j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6562-0.5798j, 0.4025+0.2670j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1151-0.8680j, 0.1287+0.4655j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7667, 0.2333]], grad_fn=<PowBackward0>)
loss:  0.2656380236148834
loss:  0.04893111065030098
loss:  0.6904338598251343
loss:  0.4850020110607147
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1191+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9982-0.j, -0.0595-0.j],
        [ 0.0595+0.j,  0.9982-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4648-0.7102j, 0.3425+0.4029j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4294+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7553-0.6554j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7553+0.6554j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4648-0.7102j, 0.3425+0.4029j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1144-0.8410j, -0.0053+0.5288j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7203, 0.2797]], grad_fn=<PowBackward0>)
loss:  0.32802432775497437
loss:  1.1989457607269287
loss:  0.11310915648937225
loss:  0.31032609939575195
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1198+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9982-0.j, -0.0599-0.j],
        [ 0.0599+0.j,  0.9982-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6074-0.6674j, 0.3356+0.2704j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4282+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7557-0.6549j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7557+0.6549j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6074-0.6674j, 0.3356+0.2704j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0219-0.9021j, 0.0765+0.4241j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8143, 0.1857]], grad_fn=<PowBackward0>)
loss:  0.20545409619808197
loss:  0.5766737461090088
loss:  0.5206974148750305
loss:  0.003616247558966279
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1203+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9982-0.j, -0.0601-0.j],
        [ 0.0601+0.j,  0.9982-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6497-0.3018j, 0.6556+0.2389j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4270+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7561-0.6545j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7561+0.6545j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6497-0.3018j, 0.6556+0.2389j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2937-0.6534j, 0.3393+0.6097j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5132, 0.4868]], grad_fn=<PowBackward0>)
loss:  0.7198485136032104
loss:  0.3448515236377716
loss:  0.6274073719978333
loss:  0.2888942062854767
----------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  ry
ry_matrix theta:  tensor([[0.1210+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9982-0.j, -0.0604-0.j],
        [ 0.0604+0.j,  0.9982-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7261-0.3745j, 0.5362+0.2120j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4257+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7565-0.6540j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7565+0.6540j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7261-0.3745j, 0.5362+0.2120j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3044-0.7582j, 0.2670+0.5111j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6675, 0.3325]], grad_fn=<PowBackward0>)
loss:  1.1011803150177002
loss:  0.2660087049007416
loss:  0.48426297307014465
loss:  0.372905969619751
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1218+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0609-0.j],
        [ 0.0609+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6692-0.6298j, 0.3282+0.2187j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4245+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7569-0.6535j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7569+0.6535j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6692-0.6298j, 0.3282+0.2187j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0949-0.9140j, 0.1055+0.3800j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8445, 0.1555]], grad_fn=<PowBackward0>)
loss:  0.1690690517425537
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.41694438457489014
------------------------------Epoch10------------------------------
--------------------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  ry
ry_matrix theta:  tensor([[0.1220+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0609-0.j],
        [ 0.0609+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6711-0.4329j, 0.5388+0.2681j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4242+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7570-0.6534j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7570+0.6534j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6711-0.4329j, 0.5388+0.2681j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2252-0.7662j, 0.2327+0.5550j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6378, 0.3622]], grad_fn=<PowBackward0>)
loss:  1.0156046152114868
loss:  0.2998563349246979
loss:  0.11945490539073944
loss:  1.3469369411468506
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1227+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0613-0.j],
        [ 0.0613+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5366-0.4633j, 0.5846+0.3946j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4231+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7573-0.6530j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7573+0.6530j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5366-0.4633j, 0.5846+0.3946j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1038-0.7012j, 0.1850+0.6806j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5025, 0.4975]], grad_fn=<PowBackward0>)
loss:  0.6982186436653137
loss:  0.11306804418563843
loss:  0.1079195961356163
loss:  0.4837058186531067
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1234+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0617-0.j],
        [ 0.0617+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4679-0.4166j, 0.6409+0.4436j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4221+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7577-0.6526j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7577+0.6526j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4679-0.4166j, 0.6409+0.4436j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0826-0.6210j, 0.1961+0.7544j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3924, 0.6076]], grad_fn=<PowBackward0>)
loss:  0.49829477071762085
loss:  0.3786882162094116
loss:  0.0038271972443908453
loss:  0.18398220837116241
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1240+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0619-0.j],
        [ 0.0619+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6551-0.5805j, 0.4042+0.2654j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4210+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7580-0.6522j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7580+0.6522j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6551-0.5805j, 0.4042+0.2654j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1180-0.8673j, 0.1333+0.4649j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7661, 0.2339]], grad_fn=<PowBackward0>)
loss:  0.26640671491622925
loss:  0.04959532618522644
loss:  0.40414711833000183
loss:  0.33295363187789917
----------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  ry
ry_matrix theta:  tensor([[0.1243+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0621-0.j],
        [ 0.0621+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5140-0.4487j, 0.6045+0.4112j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4199+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7584-0.6518j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7584+0.6518j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5140-0.4487j, 0.6045+0.4112j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0974-0.6753j, 0.1904+0.7058j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4656, 0.5344]], grad_fn=<PowBackward0>)
loss:  0.6265396475791931
loss:  0.11305102705955505
loss:  0.38609907031059265
loss:  0.6703625917434692
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1247+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9981-0.j, -0.0623-0.j],
        [ 0.0623+0.j,  0.9981-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5327-0.3624j, 0.6760+0.3576j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4188+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7587-0.6514j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7587+0.6514j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5327-0.3624j, 0.6760+0.3576j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1681-0.6220j, 0.2800+0.7117j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4151, 0.5849]], grad_fn=<PowBackward0>)
loss:  0.5363324880599976
loss:  0.14634282886981964
loss:  0.5362182855606079
loss:  0.7449673414230347
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1254+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0626-0.j],
        [ 0.0626+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.3964-0.6780j, 0.3730+0.4939j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4178+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7591-0.6510j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7591+0.6510j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3964-0.6780j, 0.3730+0.4939j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1405-0.7728j, -0.0384+0.6178j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6169, 0.3831]], grad_fn=<PowBackward0>)
loss:  0.4830586314201355
loss:  0.16943544149398804
loss:  0.12619370222091675
loss:  0.2666761875152588
----------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  ry
ry_matrix theta:  tensor([[0.1259+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0629-0.j],
        [ 0.0629+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6336-0.3382j, 0.6429+0.2661j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4167+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7594-0.6506j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7594+0.6506j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6336-0.3382j, 0.6429+0.2661j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2612-0.6690j, 0.3151+0.6204j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5158, 0.4842]], grad_fn=<PowBackward0>)
loss:  0.7253022193908691
loss:  0.3718002140522003
loss:  0.5918290615081787
loss:  0.29442721605300903
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1265+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0632-0.j],
        [ 0.0632+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4549-0.3796j, 0.6780+0.4350j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4156+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7598-0.6502j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7598+0.6502j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4549-0.3796j, 0.6780+0.4350j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0988-0.5842j, 0.2323+0.7713j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3511, 0.6489]], grad_fn=<PowBackward0>)
loss:  0.4324658513069153
loss:  0.24605831503868103
loss:  0.16956594586372375
loss:  0.30551135540008545
----------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  ry
ry_matrix theta:  tensor([[0.1271+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0635-0.j],
        [ 0.0635+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5049-0.5824j, 0.4759+0.4235j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4145+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7601-0.6498j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7601+0.6498j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5049-0.5824j, 0.4759+0.4235j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0054-0.7708j, 0.0866+0.6311j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5942, 0.4058]], grad_fn=<PowBackward0>)
loss:  0.5206192135810852
loss:  0.326602965593338
loss:  0.2056807428598404
loss:  0.048155251890420914
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1275+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0637-0.j],
        [ 0.0637+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6745-0.5539j, 0.4179+0.2521j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4135+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7605-0.6493j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7605+0.6493j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6745-0.5539j, 0.4179+0.2521j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1533-0.8593j, 0.1541+0.4631j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7618, 0.2382]], grad_fn=<PowBackward0>)
loss:  0.2720519006252289
loss:  0.32251039147377014
loss:  0.6875029802322388
loss:  0.5272004008293152
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1278+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9980-0.j, -0.0638-0.j],
        [ 0.0638+0.j,  0.9980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3381-0.3041j, 0.7432+0.4908j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4124+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7608-0.6489j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7608+0.6489j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3381-0.3041j, 0.7432+0.4908j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0599-0.4508j, 0.2470+0.8557j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2068, 0.7932]], grad_fn=<PowBackward0>)
loss:  0.23171593248844147
loss:  0.4392264187335968
loss:  0.8570361137390137
loss:  0.12979738414287567
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1281+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9979-0.j, -0.0640-0.j],
        [ 0.0640+0.j,  0.9979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8263+0.j, 0.5632+0.j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4113+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7612-0.6485j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7612+0.6485j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8263+0.j, 0.5632+0.j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.6290-0.5359j, 0.4287+0.3653j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6828, 0.3172]], grad_fn=<PowBackward0>)
loss:  1.1481273174285889
loss:  0.3264153301715851
loss:  0.3583204746246338
loss:  0.38423657417297363
----------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  ry
ry_matrix theta:  tensor([[0.1288+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9979-0.j, -0.0644-0.j],
        [ 0.0644+0.j,  0.9979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6157-0.5944j, 0.4200+0.3018j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4102+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7615-0.6481j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7615+0.6481j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6157-0.5944j, 0.4200+0.3018j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0836-0.8518j, 0.1243+0.5021j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7325, 0.2675]], grad_fn=<PowBackward0>)
loss:  0.3113061487674713
loss:  1.0937180519104004
loss:  0.713446319103241
loss:  0.6076428294181824
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1296+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9979-0.j, -0.0648-0.j],
        [ 0.0648+0.j,  0.9979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5346-0.6502j, 0.3984+0.3644j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4092+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7619-0.6477j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7619+0.6477j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5346-0.6502j, 0.3984+0.3644j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0139-0.8416j,  0.0675+0.5356j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7086, 0.2914]], grad_fn=<PowBackward0>)
loss:  0.34452998638153076
loss:  0.3569622039794922
loss:  0.57581627368927
loss:  0.4680696427822113
----------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  ry
ry_matrix theta:  tensor([[0.1304+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9979-0.j, -0.0651-0.j],
        [ 0.0651+0.j,  0.9979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6056-0.6688j, 0.3388+0.2669j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4081+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7622-0.6473j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7622+0.6473j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6056-0.6688j, 0.3388+0.2669j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0287-0.9018j, 0.0855+0.4227j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8140, 0.1860]], grad_fn=<PowBackward0>)
loss:  0.20577791333198547
loss:  0.3973999321460724
loss:  0.03710562735795975
loss:  0.004275508224964142
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1308+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9979-0.j, -0.0654-0.j],
        [ 0.0654+0.j,  0.9979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.3987-0.3453j, 0.7125+0.4627j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4070+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7626-0.6469j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7626+0.6469j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3987-0.3453j, 0.7125+0.4627j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0807-0.5212j, 0.2440+0.8138j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2782, 0.7218]], grad_fn=<PowBackward0>)
loss:  0.325981467962265
loss:  0.149818554520607
loss:  1.1846636533737183
loss:  0.3000306785106659
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1313+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0656-0.j],
        [ 0.0656+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4697-0.1628j, 0.8398+0.2181j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4059+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7629-0.6465j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7629+0.6465j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4697-0.1628j, 0.8398+0.2181j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2531-0.4279j, 0.4997+0.7093j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2471, 0.7529]], grad_fn=<PowBackward0>)
loss:  0.2838420271873474
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.415069580078125
------------------------------Epoch11------------------------------
--------------------Train--------------------
----------index0----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1315+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0657-0.j],
        [ 0.0657+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5495-0.4412j, 0.6040+0.3724j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4057+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7630-0.6464j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7630+0.6464j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5495-0.4412j, 0.6040+0.3724j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1341-0.6918j, 0.2201+0.6746j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4965, 0.5035]], grad_fn=<PowBackward0>)
loss:  0.6862137317657471
loss:  0.48115721344947815
loss:  0.2675511837005615
loss:  0.721376359462738
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1321+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0660-0.j],
        [ 0.0660+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6535-0.5815j, 0.4069+0.2631j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4047+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7633-0.6460j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7633+0.6460j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6535-0.5815j, 0.4069+0.2631j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1231-0.8661j, 0.1406+0.4637j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7652, 0.2348]], grad_fn=<PowBackward0>)
loss:  0.26759323477745056
loss:  0.6667820811271667
loss:  0.28334900736808777
loss:  0.8555449843406677
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1327+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0663-0.j],
        [ 0.0663+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5340-0.6508j, 0.3992+0.3634j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4038+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7636-0.6457j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7636+0.6457j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5340-0.6508j, 0.3992+0.3634j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0125-0.8417j,  0.0702+0.5352j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7086, 0.2914]], grad_fn=<PowBackward0>)
loss:  0.3444281816482544
loss:  0.33185875415802
loss:  0.5248109102249146
loss:  0.11991880089044571
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1333+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0666-0.j],
        [ 0.0666+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3246-0.3923j, 0.6428+0.5724j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4029+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7639-0.6453j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7639+0.6453j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3246-0.3923j, 0.6428+0.5724j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0052-0.5091j,  0.1217+0.8520j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2592, 0.7408]], grad_fn=<PowBackward0>)
loss:  0.3000750243663788
loss:  0.12693646550178528
loss:  0.6953717470169067
loss:  1.1401106119155884
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1338+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9978-0.j, -0.0668-0.j],
        [ 0.0668+0.j,  0.9978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6679-0.4345j, 0.5428+0.2655j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4020+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7642-0.6450j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7642+0.6450j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6679-0.4345j, 0.5428+0.2655j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2302-0.7628j, 0.2435+0.5530j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6349, 0.3651]], grad_fn=<PowBackward0>)
loss:  1.0075812339782715
loss:  0.30009087920188904
loss:  0.004505456890910864
loss:  0.4962291717529297
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1345+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9977-0.j, -0.0672-0.j],
        [ 0.0672+0.j,  0.9977-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5294-0.3642j, 0.6786+0.3558j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4010+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7645-0.6446j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7645+0.6446j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5294-0.3642j, 0.6786+0.3558j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1699-0.6197j, 0.2894+0.7095j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4129, 0.5871]], grad_fn=<PowBackward0>)
loss:  0.532492458820343
loss:  0.11296527087688446
loss:  0.23081645369529724
loss:  0.40421542525291443
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1351+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9977-0.j, -0.0675-0.j],
        [ 0.0675+0.j,  0.9977-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4658-0.5878j, 0.4770+0.4583j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.4001+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7648-0.6443j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7648+0.6443j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4658-0.5878j, 0.4770+0.4583j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0225-0.7497j,  0.0695+0.6578j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5625, 0.4375]], grad_fn=<PowBackward0>)
loss:  0.5753891468048096
loss:  1.3310528993606567
loss:  0.32519516348838806
loss:  0.36947566270828247
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1358+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9977-0.j, -0.0678-0.j],
        [ 0.0678+0.j,  0.9977-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6143-0.5955j, 0.4222+0.2998j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3992+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7651-0.6439j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7651+0.6439j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6143-0.5955j, 0.4222+0.2998j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0866-0.8511j, 0.1300+0.5012j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7319, 0.2681]], grad_fn=<PowBackward0>)
loss:  0.3120623826980591
loss:  0.051119402050971985
loss:  1.0871789455413818
loss:  0.3793843686580658
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1364+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9977-0.j, -0.0681-0.j],
        [ 0.0681+0.j,  0.9977-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2548-0.2720j, 0.7515+0.5444j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3983+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7654-0.6435j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7654+0.6435j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2548-0.2720j, 0.7515+0.5444j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0200-0.3721j, 0.2248+0.9003j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1389, 0.8611]], grad_fn=<PowBackward0>)
loss:  0.14953678846359253
loss:  0.4684237837791443
loss:  0.2941959500312805
loss:  0.6235905289649963
----------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  ry
ry_matrix theta:  tensor([[0.1370+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9977-0.j, -0.0684-0.j],
        [ 0.0684+0.j,  0.9977-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5758-0.6066j, 0.4324+0.3370j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3973+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7657-0.6432j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7657+0.6432j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5758-0.6066j, 0.4324+0.3370j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0508-0.8348j, 0.1143+0.5361j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6995, 0.3005]], grad_fn=<PowBackward0>)
loss:  0.3574087917804718
loss:  1.1773298978805542
loss:  0.5314143896102905
loss:  0.20602023601531982
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1376+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0688-0.j],
        [ 0.0688+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4512-0.3820j, 0.6805+0.4329j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3964+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7660-0.6428j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7660+0.6428j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4512-0.3820j, 0.6805+0.4329j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1000-0.5827j, 0.2430+0.7690j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3495, 0.6505]], grad_fn=<PowBackward0>)
loss:  0.4300338625907898
loss:  0.6045825481414795
loss:  0.3245811462402344
loss:  0.37584319710731506
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1382+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0691-0.j],
        [ 0.0691+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4229-0.1891j, 0.8427+0.2745j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3955+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7663-0.6425j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7663+0.6425j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4229-0.1891j, 0.8427+0.2745j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2025-0.4166j, 0.4694+0.7517j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2146, 0.7854]], grad_fn=<PowBackward0>)
loss:  0.24155192077159882
loss:  0.2740999162197113
loss:  0.7067428827285767
loss:  0.11294444650411606
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1388+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0693-0.j],
        [ 0.0693+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.5928-0.6203j, 0.4087+0.3111j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3945+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7666-0.6421j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7666+0.6421j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5928-0.6203j, 0.4087+0.3111j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0562-0.8562j, 0.1136+0.5009j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7362, 0.2638]], grad_fn=<PowBackward0>)
loss:  0.3062792420387268
loss:  0.39703094959259033
loss:  0.04949142038822174
loss:  0.3547227680683136
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1392+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0695-0.j],
        [ 0.0695+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.8872-0.3263j, 0.3191+0.0682j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3936+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7669-0.6418j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7669+0.6418j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8872-0.3263j, 0.3191+0.0682j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4710-0.8196j, 0.2009+0.2571j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8935, 0.1065]], grad_fn=<PowBackward0>)
loss:  0.11256014555692673
loss:  0.004853264428675175
loss:  0.1708361953496933
loss:  0.7376764416694641
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1395+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0697-0.j],
        [ 0.0697+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6663-0.6317j, 0.3341+0.2131j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3927+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7672-0.6414j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7672+0.6414j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6663-0.6317j, 0.3341+0.2131j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1060-0.9120j, 0.1196+0.3778j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8429, 0.1571]], grad_fn=<PowBackward0>)
loss:  0.17084941267967224
loss:  0.14513981342315674
loss:  0.5204989910125732
loss:  0.32447516918182373
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1397+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0698-0.j],
        [ 0.0698+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4559-0.6618j, 0.4032+0.4378j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3918+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7675-0.6411j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7675+0.6411j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4559-0.6618j, 0.4032+0.4378j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0744-0.8002j,  0.0288+0.5945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6458, 0.3542]], grad_fn=<PowBackward0>)
loss:  0.43726488947868347
loss:  0.037369176745414734
loss:  0.18176376819610596
loss:  0.1312756985425949
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1399+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9976-0.j, -0.0699-0.j],
        [ 0.0699+0.j,  0.9976-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4612-0.7143j, 0.3474+0.3955j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3908+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7678-0.6407j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7678+0.6407j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4612-0.7143j, 0.3474+0.3955j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1036-0.8439j,  0.0133+0.5262j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7229, 0.2771]], grad_fn=<PowBackward0>)
loss:  0.32442712783813477
loss:  0.47865453362464905
loss:  0.5850386619567871
loss:  0.3825746476650238
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1402+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0701-0.j],
        [ 0.0701+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6039-0.6701j, 0.3417+0.2636j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3899+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7681-0.6404j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7681+0.6404j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6039-0.6701j, 0.3417+0.2636j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0347-0.9014j, 0.0937+0.4213j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8137, 0.1863]], grad_fn=<PowBackward0>)
loss:  0.20611947774887085
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4133669435977936
------------------------------Epoch12------------------------------
--------------------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  ry
ry_matrix theta:  tensor([[0.1403+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0701-0.j],
        [ 0.0701+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4116-0.3853j, 0.6784+0.4711j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3897+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7682-0.6403j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7682+0.6403j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4116-0.3853j, 0.6784+0.4711j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0695-0.5595j, 0.2195+0.7962j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3179, 0.6821]], grad_fn=<PowBackward0>)
loss:  0.3825511336326599
loss:  0.375405490398407
loss:  0.17095032334327698
loss:  0.04966717213392258
----------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  ry
ry_matrix theta:  tensor([[0.1405+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0702-0.j],
        [ 0.0702+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4219-0.1894j, 0.8431+0.2743j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3889+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7684-0.6400j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7684+0.6400j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4219-0.1894j, 0.8431+0.2743j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2030-0.4156j, 0.4724+0.7503j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2139, 0.7861]], grad_fn=<PowBackward0>)
loss:  0.24065978825092316
loss:  0.2688619792461395
loss:  0.20613494515419006
loss:  0.17097635567188263
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1407+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0703-0.j],
        [ 0.0703+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4610-0.7145j, 0.3475+0.3952j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3881+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7687-0.6397j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7687+0.6397j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4610-0.7145j, 0.3475+0.3952j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1027-0.8441j,  0.0143+0.5261j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7230, 0.2770]], grad_fn=<PowBackward0>)
loss:  0.3242950439453125
loss:  1.1729472875595093
loss:  0.4950217008590698
loss:  0.13140994310379028
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1410+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0704-0.j],
        [ 0.0704+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.5924-0.6206j, 0.4094+0.3104j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3873+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7689-0.6394j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7689+0.6394j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5924-0.6206j, 0.4094+0.3104j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0587-0.8559j, 0.1164+0.5004j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7361, 0.2639]], grad_fn=<PowBackward0>)
loss:  0.30643001198768616
loss:  0.3002524673938751
loss:  0.5299087166786194
loss:  0.14929842948913574
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1413+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0706-0.j],
        [ 0.0706+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5158-0.6374j, 0.4224+0.3863j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3866+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7692-0.6391j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7692+0.6391j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5158-0.6374j, 0.4224+0.3863j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0106-0.8199j,  0.0780+0.5670j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6724, 0.3276]], grad_fn=<PowBackward0>)
loss:  0.39692944288253784
loss:  0.2061610221862793
loss:  0.12030728906393051
loss:  0.7046220898628235
----------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  ry
ry_matrix theta:  tensor([[0.1415+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0707-0.j],
        [ 0.0707+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.7812-0.3514j, 0.4915+0.1570j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3858+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7694-0.6388j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7694+0.6388j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7812-0.3514j, 0.4915+0.1570j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3766-0.7694j, 0.2779+0.4348j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7337, 0.2663]], grad_fn=<PowBackward0>)
loss:  1.3232567310333252
loss:  0.1449722945690155
loss:  0.47811368107795715
loss:  0.8524802923202515
----------index24----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[-4.3711e-08+0.j,  1.0000e+00+0.j]])
New state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1420+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0710-0.j],
        [ 0.0710+0.j,  0.9975-0.j]], 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.0529-0.0473j,  0.7435+0.6650j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3850+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7697-0.6385j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7697+0.6385j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0529-0.0473j,  0.7435+0.6650j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0709-0.0026j,  0.1476+0.9865j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0050, 0.9950]], grad_fn=<PowBackward0>)
loss:  0.005048779770731926
loss:  0.5295096635818481
loss:  1.0018362998962402
loss:  0.6028901934623718
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1426+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9975-0.j, -0.0712-0.j],
        [ 0.0712+0.j,  0.9975-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5307-0.4672j, 0.5899+0.3900j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3842+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7699-0.6382j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7699+0.6382j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5307-0.4672j, 0.5899+0.3900j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1104-0.6984j, 0.2053+0.6767j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4999, 0.5001]], grad_fn=<PowBackward0>)
loss:  0.6929923295974731
loss:  1.0809730291366577
loss:  0.300297349691391
loss:  0.3441018760204315
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1432+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0716-0.j],
        [ 0.0716+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5011-0.5858j, 0.4800+0.4188j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3834+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7702-0.6379j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7702+0.6379j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5011-0.5858j, 0.4800+0.4188j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0123-0.7708j, 0.1025+0.6287j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5942, 0.4058]], grad_fn=<PowBackward0>)
loss:  0.5204684734344482
loss:  0.6615678071975708
loss:  0.5746885538101196
loss:  0.22972284257411957
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1438+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0718-0.j],
        [ 0.0718+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5457-0.4434j, 0.6073+0.3697j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3827+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7704-0.6376j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7704+0.6376j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5457-0.4434j, 0.6073+0.3697j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1377-0.6896j, 0.2322+0.6720j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4945, 0.5055]], grad_fn=<PowBackward0>)
loss:  0.6821401119232178
loss:  0.11393576860427856
loss:  0.37495869398117065
loss:  0.4365435540676117
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1442+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0721-0.j],
        [ 0.0721+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3643-0.7549j, 0.2992+0.4560j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3819+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7706-0.6373j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7706+0.6373j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3643-0.7549j, 0.2992+0.4560j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2003-0.8139j, -0.0600+0.5421j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7026, 0.2974]], grad_fn=<PowBackward0>)
loss:  0.35299739241600037
loss:  0.32368090748786926
loss:  1.124355673789978
loss:  0.4688883423805237
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1448+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0723-0.j],
        [ 0.0723+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6829-0.6430j, 0.2986+0.1762j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3811+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7709-0.6370j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7709+0.6370j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.6430j, 0.2986+0.1762j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1169-0.9307j, 0.1180+0.3260j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8798, 0.1202]], grad_fn=<PowBackward0>)
loss:  0.12808462977409363
loss:  0.2753646969795227
loss:  0.29403427243232727
loss:  0.2695564925670624
----------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  ry
ry_matrix theta:  tensor([[0.1453+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0726-0.j],
        [ 0.0726+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7877-0.5731j, 0.2149+0.0697j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3803+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7711-0.6367j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7711+0.6367j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7877-0.5731j, 0.2149+0.0697j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2426-0.9435j, 0.1213+0.1905j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9490, 0.0510]], grad_fn=<PowBackward0>)
loss:  0.052372921258211136
loss:  0.037549059838056564
loss:  0.712617039680481
loss:  0.33029186725616455
----------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  ry
ry_matrix theta:  tensor([[0.1456+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9974-0.j, -0.0727-0.j],
        [ 0.0727+0.j,  0.9974-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.3935-0.3487j, 0.7154+0.4602j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3795+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7714-0.6364j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7714+0.6364j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3935-0.3487j, 0.7154+0.4602j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0816-0.5193j, 0.2590+0.8103j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2764, 0.7236]], grad_fn=<PowBackward0>)
loss:  0.32347843050956726
loss:  0.42829376459121704
loss:  0.6215052604675293
loss:  0.40431374311447144
----------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  ry
ry_matrix theta:  tensor([[0.1459+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0729-0.j],
        [ 0.0729+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7914-0.6070j, 0.0578-0.0444j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3788+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7716-0.6361j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7716+0.6361j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7914-0.6070j, 0.0578-0.0444j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2246-0.9717j, 0.0728+0.0026j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9947, 0.0053]], grad_fn=<PowBackward0>)
loss:  0.005327742546796799
loss:  0.11292435973882675
loss:  0.7342718243598938
loss:  0.27684298157691956
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1462+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0731-0.j],
        [ 0.0731+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5384-0.3391j, 0.6985+0.3275j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3780+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7719-0.6358j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7719+0.6358j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5384-0.3391j, 0.6985+0.3275j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2000-0.6040j, 0.3310+0.6969j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4048, 0.5952]], grad_fn=<PowBackward0>)
loss:  0.5188779234886169
loss:  0.32628488540649414
loss:  0.4767291843891144
loss:  0.5818732380867004
----------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  ry
ry_matrix theta:  tensor([[0.1466+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0733-0.j],
        [ 0.0733+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2027-0.2563j, 0.7426+0.5846j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3772+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7721-0.6355j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7721+0.6355j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2027-0.2563j, 0.7426+0.5846j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0063-0.3267j,  0.2019+0.9233j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11292362958192825
loss:  0.3580452799797058
loss:  0.3667655885219574
loss:  0.3133164644241333
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1470+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0734-0.j],
        [ 0.0734+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3044-0.2697j, 0.7817+0.4728j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3764+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7724-0.6352j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7724+0.6352j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3044-0.2697j, 0.7817+0.4728j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0638-0.4017j, 0.3035+0.8617j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1654, 0.8346]], grad_fn=<PowBackward0>)
loss:  0.1808031052350998
--------------------Validation--------------------
valid set accuracy: 0.931034505367279
valid set loss: 0.4120728075504303
------------------------------Epoch13------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1471+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0735-0.j],
        [ 0.0735+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5279-0.1811j, 0.8045+0.2032j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3762+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7724-0.6351j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7724+0.6351j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5279-0.1811j, 0.8045+0.2032j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2928-0.4751j, 0.4924+0.6679j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3115, 0.6885]], grad_fn=<PowBackward0>)
loss:  0.3732192814350128
loss:  0.14454980194568634
loss:  0.037613920867443085
loss:  0.8507229089736938
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1474+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0736-0.j],
        [ 0.0736+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7913-0.6069j, 0.0584-0.0448j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3756+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7727-0.6348j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7727+0.6348j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7913-0.6069j, 0.0584-0.0448j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2261-0.9713j, 0.0736+0.0025j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9946, 0.0054]], grad_fn=<PowBackward0>)
loss:  0.005434471182525158
loss:  0.7335669994354248
loss:  0.12061374634504318
loss:  0.0505242645740509
----------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  ry
ry_matrix theta:  tensor([[0.1476+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0738-0.j],
        [ 0.0738+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4325-0.3462j, 0.7188+0.4201j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3749+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7729-0.6346j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7729+0.6346j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4325-0.3462j, 0.7188+0.4201j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1146-0.5420j, 0.2890+0.7808j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3069, 0.6931]], grad_fn=<PowBackward0>)
loss:  0.36657389998435974
loss:  0.005458623170852661
loss:  0.5273432731628418
loss:  0.30042147636413574
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1479+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0739-0.j],
        [ 0.0739+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5144-0.6387j, 0.4241+0.3842j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3743+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7731-0.6343j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7731+0.6343j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5144-0.6387j, 0.4241+0.3842j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0075-0.8201j,  0.0841+0.5660j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6726, 0.3274]], grad_fn=<PowBackward0>)
loss:  0.39665690064430237
loss:  0.05273684486746788
loss:  0.17175143957138062
loss:  0.18067212402820587
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1480+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9973-0.j, -0.0739-0.j],
        [ 0.0739+0.j,  0.9973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8207+0.j, 0.5714+0.j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3737+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7733-0.6341j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7733+0.6341j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8207+0.j, 0.5714+0.j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.6346-0.5204j, 0.4419+0.3623j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6735, 0.3265]], grad_fn=<PowBackward0>)
loss:  1.1192492246627808
loss:  0.620951235294342
loss:  0.7107938528060913
loss:  0.4761694073677063
----------index20----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9230+0.j, 0.3849+0.j]])
New state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1484+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0741-0.j],
        [ 0.0741+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6648-0.6326j, 0.3371+0.2103j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3730+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7735-0.6338j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7735+0.6338j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6648-0.6326j, 0.3371+0.2103j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1132-0.9107j, 0.1275+0.3763j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8421, 0.1579]], grad_fn=<PowBackward0>)
loss:  0.1718025505542755
loss:  0.1323951929807663
loss:  0.3267485499382019
loss:  0.30695900321006775
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1487+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0743-0.j],
        [ 0.0743+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6115-0.5974j, 0.4261+0.2959j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3724+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7737-0.6336j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7737+0.6336j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6115-0.5974j, 0.4261+0.2959j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0946-0.8497j, 0.1422+0.4989j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7309, 0.2691]], grad_fn=<PowBackward0>)
loss:  0.3135227560997009
loss:  0.5204261541366577
loss:  0.5269308090209961
loss:  0.275564968585968
----------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  ry
ry_matrix theta:  tensor([[0.1489+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0744-0.j],
        [ 0.0744+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4087-0.3874j, 0.6802+0.4694j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3717+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7739-0.6333j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7739+0.6333j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4087-0.3874j, 0.6802+0.4694j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0709-0.5586j, 0.2291+0.7940j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3170, 0.6830]], grad_fn=<PowBackward0>)
loss:  0.38132408261299133
loss:  0.2064557522535324
loss:  0.3228958249092102
loss:  0.6991422176361084
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1492+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0745-0.j],
        [ 0.0745+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2500-0.2755j, 0.7531+0.5427j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3711+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7741-0.6331j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7741+0.6331j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2500-0.2755j, 0.7531+0.5427j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0191-0.3715j, 0.2394+0.8968j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1384, 0.8616]], grad_fn=<PowBackward0>)
loss:  0.1489252895116806
loss:  0.12854915857315063
loss:  0.5742055773735046
loss:  0.5804754495620728
----------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  ry
ry_matrix theta:  tensor([[0.1495+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0747-0.j],
        [ 0.0747+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4539-0.6639j, 0.4054+0.4345j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3705+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7743-0.6329j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7743+0.6329j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4539-0.6639j, 0.4054+0.4345j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0687-0.8013j,  0.0389+0.5930j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6468, 0.3532]], grad_fn=<PowBackward0>)
loss:  0.4356723725795746
loss:  0.47580137848854065
loss:  0.2289935201406479
loss:  0.37361636757850647
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1498+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0748-0.j],
        [ 0.0748+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5468-0.6681j, 0.3814+0.3304j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3698+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7745-0.6326j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7745+0.6326j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5468-0.6681j, 0.3814+0.3304j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0008-0.8633j, 0.0864+0.4972j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7453, 0.2547]], grad_fn=<PowBackward0>)
loss:  0.2939530313014984
loss:  0.11292322725057602
loss:  0.3004779815673828
loss:  0.996629536151886
----------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  ry
ry_matrix theta:  tensor([[0.1501+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0750-0.j],
        [ 0.0750+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2015-0.2573j, 0.7430+0.5841j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3692+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7747-0.6324j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7747+0.6324j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2015-0.2573j, 0.7430+0.5841j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0066-0.3267j,  0.2062+0.9223j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11292349547147751
loss:  1.3126399517059326
loss:  0.4043623208999634
loss:  0.2764161229133606
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1505+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0752-0.j],
        [ 0.0752+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.8854-0.3267j, 0.3241+0.0664j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3685+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7749-0.6321j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7749+0.6321j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8854-0.3267j, 0.3241+0.0664j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4796-0.8128j, 0.2092+0.2563j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8906, 0.1094]], grad_fn=<PowBackward0>)
loss:  0.11587812751531601
loss:  0.34388798475265503
loss:  0.32967519760131836
loss:  0.6581791639328003
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1507+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9972-0.j, -0.0753-0.j],
        [ 0.0753+0.j,  0.9972-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.7730-0.2989j, 0.5398+0.1476j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3679+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7751-0.6319j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7751+0.6319j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7730-0.2989j, 0.5398+0.1476j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4103-0.7201j, 0.3251+0.4555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6868, 0.3132]], grad_fn=<PowBackward0>)
loss:  1.1610362529754639
loss:  0.5168384909629822
loss:  0.23666314780712128
loss:  1.0732810497283936
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1512+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0755-0.j],
        [ 0.0755+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5348-0.4062j, 0.6463+0.3623j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3673+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7753-0.6316j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7753+0.6316j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5348-0.4062j, 0.6463+0.3623j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1580-0.6527j, 0.2722+0.6891j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4510, 0.5490]], grad_fn=<PowBackward0>)
loss:  0.5997044444084167
loss:  0.49307799339294434
loss:  0.3583662807941437
loss:  0.27055081725120544
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1518+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0758-0.j],
        [ 0.0758+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4591-0.7167j, 0.3501+0.3912j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3666+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7755-0.6314j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7755+0.6314j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4591-0.7167j, 0.3501+0.3912j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0964-0.8456j,  0.0245+0.5244j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7244, 0.2756]], grad_fn=<PowBackward0>)
loss:  0.3224491775035858
loss:  0.27058377861976624
loss:  0.2065751850605011
loss:  0.6794053912162781
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1521+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0760-0.j],
        [ 0.0760+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.3792-0.4804j, 0.5811+0.5364j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3660+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7757-0.6311j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7757+0.6311j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3792-0.4804j, 0.5811+0.5364j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0090-0.6120j,  0.1122+0.7828j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3746, 0.6254]], grad_fn=<PowBackward0>)
loss:  0.4693274199962616
loss:  0.32237881422042847
loss:  0.35032445192337036
loss:  0.4268600642681122
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1524+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0761-0.j],
        [ 0.0761+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5278-0.4691j, 0.5925+0.3877j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3654+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7759-0.6309j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7759+0.6309j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5278-0.4691j, 0.5925+0.3877j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1136-0.6969j, 0.2151+0.6746j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4986, 0.5014]], grad_fn=<PowBackward0>)
loss:  0.6904230117797852
--------------------Validation--------------------
valid set accuracy: 0.931034505367279
valid set loss: 0.41104960441589355
------------------------------Epoch14------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1525+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0762-0.j],
        [ 0.0762+0.j,  0.9971-0.j]], 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.0568-0.0508j,  0.7432+0.6647j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3652+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7759-0.6308j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7759+0.6308j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0568-0.0508j,  0.7432+0.6647j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0761-0.0036j,  0.1574+0.9846j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0058, 0.9942]], grad_fn=<PowBackward0>)
loss:  0.005819771904498339
loss:  0.6903862953186035
loss:  0.31397125124931335
loss:  0.7079159617424011
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1527+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0763-0.j],
        [ 0.0763+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4192-0.3683j, 0.7007+0.4446j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3647+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7761-0.6306j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7761+0.6306j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4192-0.3683j, 0.7007+0.4446j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0930-0.5502j, 0.2634+0.7869j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3114, 0.6886]], grad_fn=<PowBackward0>)
loss:  0.3730464279651642
loss:  0.235956609249115
loss:  0.005848309490829706
loss:  0.5787646770477295
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1530+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0764-0.j],
        [ 0.0764+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3021-0.2711j, 0.7826+0.4720j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3642+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7763-0.6304j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7763+0.6304j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3021-0.2711j, 0.7826+0.4720j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0636-0.4009j, 0.3099+0.8598j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1647, 0.8353]], grad_fn=<PowBackward0>)
loss:  0.18001560866832733
loss:  0.36984771490097046
loss:  0.32221749424934387
loss:  0.11292776465415955
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1533+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0766-0.j],
        [ 0.0766+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4604-0.1652j, 0.8449+0.2163j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3637+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7764-0.6302j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7764+0.6302j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4604-0.1652j, 0.8449+0.2163j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2534-0.4184j, 0.5197+0.7004j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2393, 0.7607]], grad_fn=<PowBackward0>)
loss:  0.27349531650543213
loss:  0.3293377757072449
loss:  0.36518755555152893
loss:  0.3221544921398163
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1536+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9971-0.j, -0.0767-0.j],
        [ 0.0767+0.j,  0.9971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4588-0.7170j, 0.3505+0.3906j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3632+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7766-0.6300j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7766+0.6300j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4588-0.7170j, 0.3505+0.3906j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0955-0.8459j,  0.0261+0.5241j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7246, 0.2754]], grad_fn=<PowBackward0>)
loss:  0.3221423029899597
loss:  0.3585142493247986
loss:  0.14405933022499084
loss:  0.5250009298324585
----------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  ry
ry_matrix theta:  tensor([[0.1539+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0769-0.j],
        [ 0.0769+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4456-0.3855j, 0.6842+0.4298j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3627+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7767-0.6298j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7767+0.6298j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4456-0.3855j, 0.6842+0.4298j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1033-0.5801j, 0.2607+0.7647j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3472, 0.6528]], grad_fn=<PowBackward0>)
loss:  0.4265303611755371
loss:  0.2709074318408966
loss:  0.4925972521305084
loss:  0.03786138445138931
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1541+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0770-0.j],
        [ 0.0770+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6015-0.6719j, 0.3459+0.2589j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3622+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7769-0.6296j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7769+0.6296j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6015-0.6719j, 0.3459+0.2589j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0442-0.9007j, 0.1057+0.4190j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8133, 0.1867]], grad_fn=<PowBackward0>)
loss:  0.20666474103927612
loss:  0.27093902230262756
loss:  0.3005951941013336
loss:  1.0703901052474976
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1543+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0771-0.j],
        [ 0.0771+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6498-0.5461j, 0.4555+0.2686j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3617+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7771-0.6294j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7771+0.6294j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6498-0.5461j, 0.4555+0.2686j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1612-0.8333j, 0.1848+0.4954j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7204, 0.2796]], grad_fn=<PowBackward0>)
loss:  0.3279155194759369
loss:  0.34378501772880554
loss:  1.3074705600738525
loss:  0.6786114573478699
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1545+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0772-0.j],
        [ 0.0772+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.1998-0.2586j, 0.7434+0.5836j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3611+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7772-0.6292j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7772+0.6292j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1998-0.2586j, 0.7434+0.5836j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0074-0.3267j,  0.2106+0.9213j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11293070018291473
loss:  0.5984901189804077
loss:  0.05140480399131775
loss:  0.17249201238155365
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1548+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0773-0.j],
        [ 0.0773+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8187+0.j, 0.5742+0.j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3606+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7774-0.6290j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7774+0.6290j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8187+0.j, 0.5742+0.j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.6364-0.5150j, 0.4464+0.3612j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6703, 0.3297]], grad_fn=<PowBackward0>)
loss:  1.109574556350708
loss:  0.47422805428504944
loss:  0.12101070582866669
loss:  0.17252933979034424
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1551+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0775-0.j],
        [ 0.0775+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.5716-0.3929j, 0.6434+0.3238j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3601+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7775-0.6288j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7775+0.6288j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5716-0.3929j, 0.6434+0.3238j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1974-0.6650j, 0.2966+0.6564j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4811, 0.5189]], grad_fn=<PowBackward0>)
loss:  0.6560867428779602
loss:  0.34934210777282715
loss:  0.20671546459197998
loss:  0.8480774164199829
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1555+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0777-0.j],
        [ 0.0777+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.8846-0.3268j, 0.3263+0.0655j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3596+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7777-0.6286j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7777+0.6286j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8846-0.3268j, 0.3263+0.0655j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4824-0.8102j, 0.2125+0.2561j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8892, 0.1108]], grad_fn=<PowBackward0>)
loss:  0.11737722158432007
loss:  0.5243426561355591
loss:  0.4740195870399475
loss:  0.40442803502082825
----------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  ry
ry_matrix theta:  tensor([[0.1557+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0778-0.j],
        [ 0.0778+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5045-0.4551j, 0.6125+0.4041j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3591+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7778-0.6285j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7778+0.6285j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5045-0.4551j, 0.6125+0.4041j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1064-0.6710j, 0.2225+0.6992j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4616, 0.5384]], grad_fn=<PowBackward0>)
loss:  0.6191798448562622
loss:  0.30064091086387634
loss:  0.9926764965057373
loss:  0.4695565402507782
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1560+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0779-0.j],
        [ 0.0779+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3276-0.3110j, 0.7479+0.4864j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3586+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7780-0.6283j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7780+0.6283j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3276-0.3110j, 0.7479+0.4864j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0595-0.4478j, 0.2763+0.8483j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2041, 0.7959]], grad_fn=<PowBackward0>)
loss:  0.22823868691921234
loss:  0.5736566185951233
loss:  0.05387997627258301
loss:  0.13341055810451508
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1562+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9970-0.j, -0.0780-0.j],
        [ 0.0780+0.j,  0.9970-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6685-0.5575j, 0.4275+0.2441j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3581+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7782-0.6281j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7782+0.6281j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6685-0.5575j, 0.4275+0.2441j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1701-0.8536j, 0.1793+0.4585j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7576, 0.2424]], grad_fn=<PowBackward0>)
loss:  0.2775614857673645
loss:  0.729093611240387
loss:  1.154423713684082
loss:  0.4345702528953552
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1564+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0781-0.j],
        [ 0.0781+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5126-0.6403j, 0.4263+0.3815j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3576+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7783-0.6279j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7783+0.6279j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5126-0.6403j, 0.4263+0.3815j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0031-0.8202j,  0.0923+0.5645j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6728, 0.3272]], grad_fn=<PowBackward0>)
loss:  0.3963196575641632
loss:  0.3075183629989624
loss:  0.12932446599006653
loss:  0.38025328516960144
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1567+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0782-0.j],
        [ 0.0782+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.4979-0.5886j, 0.4833+0.4148j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3571+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7785-0.6277j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7785+0.6277j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4979-0.5886j, 0.4833+0.4148j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0181-0.7707j, 0.1159+0.6263j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5943, 0.4057]], grad_fn=<PowBackward0>)
loss:  0.5203744173049927
loss:  0.5142384171485901
loss:  0.293846994638443
loss:  0.6936835646629333
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1569+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0784-0.j],
        [ 0.0784+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2471-0.2775j, 0.7540+0.5416j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3566+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7786-0.6275j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7786+0.6275j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2471-0.2775j, 0.7540+0.5416j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0183-0.3711j, 0.2473+0.8949j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1381, 0.8619]], grad_fn=<PowBackward0>)
loss:  0.14859233796596527
--------------------Validation--------------------
valid set accuracy: 0.931034505367279
valid set loss: 0.4102199077606201
------------------------------Epoch15------------------------------
--------------------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  ry
ry_matrix theta:  tensor([[0.1569+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0784-0.j],
        [ 0.0784+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4177-0.3693j, 0.7016+0.4438j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3565+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7787-0.6274j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7787+0.6274j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4177-0.3693j, 0.7016+0.4438j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0936-0.5496j, 0.2678+0.7858j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3108, 0.6892]], grad_fn=<PowBackward0>)
loss:  0.37225621938705444
loss:  0.5237805843353271
loss:  0.3643445074558258
loss:  0.5203717947006226
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1571+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0785-0.j],
        [ 0.0785+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.1988-0.2593j, 0.7437+0.5832j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3561+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7788-0.6273j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7788+0.6273j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1988-0.2593j, 0.7437+0.5832j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0078-0.3267j,  0.2133+0.9207j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11293904483318329
loss:  0.6934131383895874
loss:  0.43442684412002563
loss:  0.46963977813720703
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1573+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0786-0.j],
        [ 0.0786+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6633-0.6336j, 0.3401+0.2074j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3557+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7789-0.6271j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7789+0.6271j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6633-0.6336j, 0.3401+0.2074j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1193-0.9094j, 0.1348+0.3748j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8413, 0.1587]], grad_fn=<PowBackward0>)
loss:  0.17278321087360382
loss:  0.11294004321098328
loss:  0.12114579230546951
loss:  0.12942269444465637
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1575+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0787-0.j],
        [ 0.0787+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5124-0.6405j, 0.4265+0.3811j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3553+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7790-0.6270j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7790+0.6270j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5124-0.6405j, 0.4265+0.3811j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0024-0.8203j,  0.0933+0.5643j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6728, 0.3272]], grad_fn=<PowBackward0>)
loss:  0.39627915620803833
loss:  0.3288491368293762
loss:  0.3801245093345642
loss:  0.5974189639091492
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1576+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0787-0.j],
        [ 0.0787+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4586-0.1657j, 0.8459+0.2159j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3549+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7792-0.6268j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7792+0.6268j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4586-0.1657j, 0.8459+0.2159j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2535-0.4165j, 0.5238+0.6985j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2378, 0.7622]], grad_fn=<PowBackward0>)
loss:  0.27151352167129517
loss:  0.5735278725624084
loss:  0.05410173907876015
loss:  0.3436966836452484
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.1577+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0788-0.j],
        [ 0.0788+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.3904-0.6859j, 0.3794+0.4829j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3546+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7793-0.6267j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7793+0.6267j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3904-0.6859j, 0.3794+0.4829j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1257-0.7792j, -0.0070+0.6141j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6229, 0.3771]], grad_fn=<PowBackward0>)
loss:  0.47338974475860596
loss:  0.677511990070343
loss:  0.17283444106578827
loss:  0.7282751202583313
----------index24----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1579+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0789-0.j],
        [ 0.0789+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.5600-0.3529j, 0.6813+0.3126j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3542+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7794-0.6265j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7794+0.6265j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5600-0.3529j, 0.6813+0.3126j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2154-0.6258j, 0.3352+0.6705j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4381, 0.5619]], grad_fn=<PowBackward0>)
loss:  0.5763750076293945
loss:  0.03801169991493225
loss:  0.14854677021503448
loss:  0.05182958021759987
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1580+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0789-0.j],
        [ 0.0789+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6489-0.5466j, 0.4567+0.2676j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3538+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7795-0.6264j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7795+0.6264j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6489-0.5466j, 0.4567+0.2676j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1634-0.8326j, 0.1884+0.4946j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7199, 0.2801]], grad_fn=<PowBackward0>)
loss:  0.3287009000778198
loss:  0.0062532625161111355
loss:  0.31461119651794434
loss:  0.9911513328552246
----------index32----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1581+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0790-0.j],
        [ 0.0790+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6008-0.6724j, 0.3471+0.2576j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3534+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7796-0.6262j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7796+0.6262j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6008-0.6724j, 0.3471+0.2576j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0473-0.9005j, 0.1094+0.4182j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8132, 0.1868]], grad_fn=<PowBackward0>)
loss:  0.20683690905570984
loss:  0.20683808624744415
loss:  0.2715708613395691
loss:  0.277959406375885
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1582+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0790-0.j],
        [ 0.0790+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3268-0.3116j, 0.7482+0.4861j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3530+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7798-0.6261j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7798+0.6261j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3268-0.3116j, 0.7482+0.4861j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0598-0.4475j, 0.2791+0.8475j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2039, 0.7961]], grad_fn=<PowBackward0>)
loss:  0.22797706723213196
loss:  0.30071207880973816
loss:  0.3007124960422516
loss:  1.3027019500732422
----------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  ry
ry_matrix theta:  tensor([[0.1583+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0791-0.j],
        [ 0.0791+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.7709-0.2994j, 0.5427+0.1465j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3526+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7799-0.6259j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7799+0.6259j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7709-0.2994j, 0.5427+0.1465j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4138-0.7161j, 0.3315+0.4540j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6840, 0.3160]], grad_fn=<PowBackward0>)
loss:  1.1520302295684814
loss:  0.6185703873634338
loss:  0.513480544090271
loss:  0.11828761547803879
----------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  ry
ry_matrix theta:  tensor([[0.1585+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0792-0.j],
        [ 0.0792+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.5705-0.3935j, 0.6444+0.3232j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3523+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7800-0.6258j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7800+0.6258j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5705-0.3935j, 0.6444+0.3232j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1988-0.6639j, 0.3004+0.6553j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4803, 0.5197]], grad_fn=<PowBackward0>)
loss:  0.6545130014419556
loss:  0.1337413638830185
loss:  0.32131800055503845
loss:  0.14370368421077728
----------index48----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1588+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9969-0.j, -0.0793-0.j],
        [ 0.0793+0.j,  0.9969-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4564-0.4244j, 0.6491+0.4362j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3519+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7801-0.6256j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7801+0.6256j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4564-0.4244j, 0.6491+0.4362j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0906-0.6166j, 0.2334+0.7464j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3884, 0.6116]], grad_fn=<PowBackward0>)
loss:  0.4917317032814026
loss:  0.23368589580059052
loss:  0.5230643153190613
loss:  0.42546170949935913
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1590+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0794-0.j],
        [ 0.0794+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.5887-0.6234j, 0.4147+0.3048j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3515+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7802-0.6255j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7802+0.6255j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5887-0.6234j, 0.4147+0.3048j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0694-0.8546j, 0.1329+0.4972j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7351, 0.2649]], grad_fn=<PowBackward0>)
loss:  0.3076995611190796
loss:  0.17924371361732483
loss:  0.7038014531135559
loss:  0.3480578660964966
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1592+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0795-0.j],
        [ 0.0795+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5710-0.6103j, 0.4387+0.3302j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3511+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7804-0.6253j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7804+0.6253j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5710-0.6103j, 0.4387+0.3302j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0639-0.8333j, 0.1359+0.5321j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6984, 0.3016]], grad_fn=<PowBackward0>)
loss:  0.3588951528072357
loss:  1.1032449007034302
loss:  0.472922682762146
loss:  0.6886008977890015
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1595+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0797-0.j],
        [ 0.0797+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5328-0.6192j, 0.4445+0.3676j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3507+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7805-0.6252j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7805+0.6252j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5328-0.6192j, 0.4445+0.3676j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0288-0.8164j, 0.1171+0.5648j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6673, 0.3327]], grad_fn=<PowBackward0>)
loss:  0.4044792354106903
loss:  0.2938087582588196
loss:  1.065415620803833
loss:  0.3211462199687958
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1598+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0798-0.j],
        [ 0.0798+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7910-0.6066j, 0.0633-0.0486j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3503+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7806-0.6250j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7806+0.6250j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7910-0.6066j, 0.0633-0.0486j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2383-0.9679j, 0.0798+0.0017j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9936, 0.0064]], grad_fn=<PowBackward0>)
loss:  0.006389903370290995
loss:  0.3211221396923065
loss:  0.36602985858917236
loss:  0.8465667366981506
----------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  ry
ry_matrix theta:  tensor([[0.1601+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0800-0.j],
        [ 0.0800+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6477-0.5852j, 0.4160+0.2549j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3500+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7807-0.6249j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7807+0.6249j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6477-0.5852j, 0.4160+0.2549j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1400-0.8616j, 0.1655+0.4590j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7620, 0.2380]], grad_fn=<PowBackward0>)
loss:  0.2718673646450043
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.4096260368824005
------------------------------Epoch16------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1601+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0800-0.j],
        [ 0.0800+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.5592-0.3532j, 0.6820+0.3122j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3499+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7807-0.6248j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7807+0.6248j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.3532j, 0.6820+0.3122j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2159-0.6252j, 0.3374+0.6699j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4375, 0.5625]], grad_fn=<PowBackward0>)
loss:  0.5752865672111511
loss:  0.3007708787918091
loss:  0.11295292526483536
loss:  0.5225206017494202
----------index4----------
train inputs:  tensor([[1.6821, 2.0731]], 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.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([[2.0731]], dtype=torch.float64)
Inside  rz
rz_matrix theta:  tensor([[2.0731+0.j]])
rz_matrix:  tensor([[0.5092-0.8607j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.5092+0.8607j]])
Performing matrix multiplication

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1603+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0801-0.j],
        [ 0.0801+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3080-0.6233j, 0.4055+0.5935j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3496+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7808-0.6247j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7808+0.6247j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3080-0.6233j, 0.4055+0.5935j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1489-0.6791j, -0.0542+0.7167j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4833, 0.5167]], grad_fn=<PowBackward0>)
loss:  0.7270202040672302
loss:  0.3476513624191284
loss:  0.3716079592704773
loss:  0.5203530192375183
----------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  ry
ry_matrix theta:  tensor([[0.1605+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0802-0.j],
        [ 0.0802+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4279-0.3489j, 0.7216+0.4178j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3493+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7809-0.6246j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7809+0.6246j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4279-0.3489j, 0.7216+0.4178j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1162-0.5397j, 0.3025+0.7770j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3048, 0.6952]], grad_fn=<PowBackward0>)
loss:  0.36353200674057007
loss:  0.1484423577785492
loss:  0.006453311070799828
loss:  0.688286542892456
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1606+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0802-0.j],
        [ 0.0802+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7860-0.5736j, 0.2209+0.0653j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3491+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7810-0.6245j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7810+0.6245j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7860-0.5736j, 0.2209+0.0653j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2556-0.9389j, 0.1318+0.1890j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9469, 0.0531]], grad_fn=<PowBackward0>)
loss:  0.05452759936451912
loss:  0.6909436583518982
loss:  0.320982962846756
loss:  0.522334635257721
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1608+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0803-0.j],
        [ 0.0803+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4516-0.6664j, 0.4080+0.4308j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3488+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7811-0.6244j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7811+0.6244j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4516-0.6664j, 0.4080+0.4308j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0634-0.8025j,  0.0497+0.5912j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6480, 0.3520]], grad_fn=<PowBackward0>)
loss:  0.433861643075943
loss:  0.23291954398155212
loss:  0.3284532129764557
loss:  0.1731853485107422
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.1610+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0804-0.j],
        [ 0.0804+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6605-0.4380j, 0.5518+0.2596j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3485+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7812-0.6243j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7812+0.6243j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6605-0.4380j, 0.5518+0.2596j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2425-0.7545j, 0.2690+0.5473j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6281, 0.3719]], grad_fn=<PowBackward0>)
loss:  0.9892325401306152
loss:  0.7025591731071472
loss:  0.3149605095386505
loss:  0.4698716402053833
----------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  ry
ry_matrix theta:  tensor([[0.1611+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0805-0.j],
        [ 0.0805+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5282-0.6559j, 0.4067+0.3541j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3482+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7813-0.6242j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7813+0.6242j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5282-0.6559j, 0.4067+0.3541j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0033-0.8421j, 0.0967+0.5305j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7092, 0.2908]], grad_fn=<PowBackward0>)
loss:  0.343610942363739
loss:  0.05223406106233597
loss:  0.3078644871711731
loss:  0.32936352491378784
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1612+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0805-0.j],
        [ 0.0805+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6475-0.5853j, 0.4164+0.2546j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3480+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7813-0.6241j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7813+0.6241j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6475-0.5853j, 0.4164+0.2546j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1406-0.8614j, 0.1665+0.4588j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7618, 0.2382]], grad_fn=<PowBackward0>)
loss:  0.27205127477645874
loss:  0.1213625967502594
loss:  0.27856704592704773
loss:  0.2276221066713333
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1613+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9968-0.j, -0.0806-0.j],
        [ 0.0806+0.j,  0.9968-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.3897-0.6868j, 0.3801+0.4817j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3477+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7814-0.6240j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7814+0.6240j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3897-0.6868j, 0.3801+0.4817j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1241-0.7798j, -0.0036+0.6136j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6235, 0.3765]], grad_fn=<PowBackward0>)
loss:  0.4723495543003082
loss:  0.03814810514450073
loss:  0.3208884596824646
loss:  0.1435205191373825
----------index36----------
train inputs:  tensor([[1.1512, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1613+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0806-0.j],
        [ 0.0806+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7152-0.3787j, 0.5508+0.2044j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3474+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7815-0.6239j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7815+0.6239j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7152-0.3787j, 0.5508+0.2044j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3227-0.7421j, 0.3029+0.5034j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6549, 0.3451]], grad_fn=<PowBackward0>)
loss:  1.0638586282730103
loss:  0.42494502663612366
loss:  0.30080702900886536
loss:  0.2069811075925827
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1614+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0806-0.j],
        [ 0.0806+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6474-0.5853j, 0.4164+0.2545j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3471+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7816-0.6238j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7816+0.6238j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6474-0.5853j, 0.4164+0.2545j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1409-0.8614j, 0.1667+0.4587j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7618, 0.2382]], grad_fn=<PowBackward0>)
loss:  0.2720818817615509
loss:  1.1001135110855103
loss:  0.1129595935344696
loss:  1.1481956243515015
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1616+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0807-0.j],
        [ 0.0807+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4594-0.5938j, 0.4831+0.4504j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3469+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7817-0.6237j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7817+0.6237j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4594-0.5938j, 0.4831+0.4504j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0112-0.7507j,  0.0967+0.6534j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5637, 0.4363]], grad_fn=<PowBackward0>)
loss:  0.5732080936431885
loss:  0.6530845761299133
loss:  0.3208260238170624
loss:  0.4911903440952301
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1618+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0808-0.j],
        [ 0.0808+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5314-0.4081j, 0.6491+0.3602j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3466+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7818-0.6236j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7818+0.6236j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5314-0.4081j, 0.6491+0.3602j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1609-0.6504j, 0.2829+0.6863j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4489, 0.5511]], grad_fn=<PowBackward0>)
loss:  0.5958993434906006
loss:  0.6761717200279236
loss:  0.29377901554107666
loss:  0.472156286239624
----------index52----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1620+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0809-0.j],
        [ 0.0809+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.7761-0.3530j, 0.4995+0.1534j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3463+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7819-0.6235j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7819+0.6235j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7761-0.3530j, 0.4995+0.1534j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3867-0.7599j, 0.2949+0.4314j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7270, 0.2730]], grad_fn=<PowBackward0>)
loss:  1.298133373260498
loss:  0.8458947539329529
loss:  0.3591018617153168
loss:  0.11940392851829529
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1622+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0810-0.j],
        [ 0.0810+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5114-0.6414j, 0.4277+0.3796j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3461+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7819-0.6234j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7819+0.6234j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5114-0.6414j, 0.4277+0.3796j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[1.8477e-06-0.8203j, 9.7831e-02+0.5635j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6729, 0.3271]], grad_fn=<PowBackward0>)
loss:  0.39610210061073303
loss:  0.36473482847213745
loss:  0.37946781516075134
loss:  0.5117489695549011
----------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  ry
ry_matrix theta:  tensor([[0.1624+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0811-0.j],
        [ 0.0811+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6001-0.6730j, 0.3484+0.2561j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3458+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7820-0.6232j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7820+0.6232j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6001-0.6730j, 0.3484+0.2561j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0498-0.9003j, 0.1128+0.4175j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8130, 0.1870]], grad_fn=<PowBackward0>)
loss:  0.2070256769657135
loss:  0.6176222562789917
loss:  0.1733633428812027
loss:  0.17879992723464966
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1626+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0812-0.j],
        [ 0.0812+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4565-0.1662j, 0.8471+0.2155j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3455+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7821-0.6231j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7821+0.6231j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4565-0.1662j, 0.8471+0.2155j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2535-0.4145j, 0.5282+0.6964j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2360, 0.7640]], grad_fn=<PowBackward0>)
loss:  0.26922619342803955
loss:  0.13428780436515808
loss:  0.40452396869659424
loss:  0.1299940049648285
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1627+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0813-0.j],
        [ 0.0813+0.j,  0.9967-0.j]], 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.0606-0.0542j,  0.7429+0.6645j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3452+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7822-0.6230j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7822+0.6230j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0606-0.0542j,  0.7429+0.6645j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0811-0.0046j,  0.1671+0.9826j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0066, 0.9934]], grad_fn=<PowBackward0>)
loss:  0.006623758934438229
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.40915149450302124
------------------------------Epoch17------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1627+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0813-0.j],
        [ 0.0813+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6332-0.6962j, 0.2837+0.1841j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3452+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7822-0.6230j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7822+0.6230j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6332-0.6962j, 0.2837+0.1841j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0616-0.9391j, 0.1072+0.3207j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8856, 0.1144]], grad_fn=<PowBackward0>)
loss:  0.12144678831100464
loss:  0.006626458838582039
loss:  0.574039101600647
loss:  0.6894859671592712
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1628+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0813-0.j],
        [ 0.0813+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.2520-0.2648j, 0.7766+0.5130j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3450+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7823-0.6229j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7823+0.6229j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2520-0.2648j, 0.7766+0.5130j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0322-0.3641j, 0.2880+0.8851j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1336, 0.8664]], grad_fn=<PowBackward0>)
loss:  0.14341986179351807
loss:  0.32064852118492126
loss:  1.1466854810714722
loss:  0.3435695171356201
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1629+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0813-0.j],
        [ 0.0813+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4125-0.1925j, 0.8478+0.2721j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3448+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7823-0.6229j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7823+0.6229j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4125-0.1925j, 0.8478+0.2721j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2028-0.4075j, 0.4938+0.7410j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2072, 0.7928]], grad_fn=<PowBackward0>)
loss:  0.232157900929451
loss:  1.0624198913574219
loss:  0.30085477232933044
loss:  0.6175010204315186
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1630+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0814-0.j],
        [ 0.0814+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4571-0.7188j, 0.3527+0.3872j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3446+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7824-0.6228j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7824+0.6228j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4571-0.7188j, 0.3527+0.3872j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0900-0.8471j,  0.0348+0.5226j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7257, 0.2743]], grad_fn=<PowBackward0>)
loss:  0.3206135332584381
loss:  0.36293914914131165
loss:  1.2968153953552246
loss:  0.3793581426143646
----------index16----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1631+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0815-0.j],
        [ 0.0815+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6670-0.5583j, 0.4298+0.2422j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3445+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7824-0.6227j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7824+0.6227j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6670-0.5583j, 0.4298+0.2422j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1742-0.8522j, 0.1855+0.4572j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7566, 0.2434]], grad_fn=<PowBackward0>)
loss:  0.27894338965415955
loss:  0.36422377824783325
loss:  0.5730758309364319
loss:  0.471771776676178
----------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  ry
ry_matrix theta:  tensor([[0.1633+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0816-0.j],
        [ 0.0816+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4424-0.3876j, 0.6862+0.4279j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3443+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7825-0.6227j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7825+0.6227j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4424-0.3876j, 0.6862+0.4279j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1049-0.5787j, 0.2705+0.7622j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3459, 0.6541]], grad_fn=<PowBackward0>)
loss:  0.4245375990867615
loss:  0.30086684226989746
loss:  0.3281655013561249
loss:  1.0973865985870361
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1634+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0816-0.j],
        [ 0.0816+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7024-0.6171j, 0.3150+0.1629j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3441+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7825-0.6226j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7825+0.6226j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7024-0.6171j, 0.3150+0.1629j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1654-0.9203j, 0.1450+0.3236j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8742, 0.1258]], grad_fn=<PowBackward0>)
loss:  0.13440077006816864
loss:  0.052530836313962936
loss:  0.8454247713088989
loss:  0.17348094284534454
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1635+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0817-0.j],
        [ 0.0817+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5308-0.4085j, 0.6496+0.3598j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3439+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7826-0.6225j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7826+0.6225j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5308-0.4085j, 0.6496+0.3598j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1611-0.6501j, 0.2844+0.6860j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4486, 0.5514]], grad_fn=<PowBackward0>)
loss:  0.5952688455581665
loss:  0.3960524797439575
loss:  0.3465905487537384
loss:  0.3298685848712921
----------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  ry
ry_matrix theta:  tensor([[0.1636+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0817-0.j],
        [ 0.0817+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6622-0.6342j, 0.3422+0.2055j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3437+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7827-0.6225j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7827+0.6225j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6622-0.6342j, 0.3422+0.2055j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1235-0.9086j, 0.1399+0.3738j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8407, 0.1593]], grad_fn=<PowBackward0>)
loss:  0.17349597811698914
loss:  0.11297294497489929
loss:  0.4334047734737396
loss:  0.6521302461624146
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1637+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9967-0.j, -0.0818-0.j],
        [ 0.0818+0.j,  0.9967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6801-0.6446j, 0.3051+0.1701j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3436+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7827-0.6224j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7827+0.6224j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6801-0.6446j, 0.3051+0.1701j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1311-0.9278j, 0.1329+0.3230j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8780, 0.1220]], grad_fn=<PowBackward0>)
loss:  0.13011157512664795
loss:  0.5203362703323364
loss:  0.2273358851671219
loss:  0.11988997459411621
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1638+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0818-0.j],
        [ 0.0818+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5194-0.3694j, 0.6863+0.3505j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3434+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7828-0.6223j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7828+0.6223j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5194-0.3694j, 0.6863+0.3505j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1767-0.6123j, 0.3191+0.7014j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4062, 0.5938]], grad_fn=<PowBackward0>)
loss:  0.5211779475212097
loss:  0.03825300559401512
loss:  0.4045413136482239
loss:  0.14831292629241943
----------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  ry
ry_matrix theta:  tensor([[0.1638+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0818-0.j],
        [ 0.0818+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.1964-0.2613j, 0.7443+0.5824j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3432+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7828-0.6222j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7828+0.6222j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1964-0.2613j, 0.7443+0.5824j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0089-0.3267j,  0.2203+0.9190j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11297421157360077
loss:  0.20709078013896942
loss:  0.2070910781621933
loss:  0.35922521352767944
----------index48----------
train inputs:  tensor([[1.5338, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1638+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0818-0.j],
        [ 0.0818+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5396-0.4471j, 0.6128+0.3653j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3430+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7829-0.6222j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7829+0.6222j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5396-0.4471j, 0.6128+0.3653j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1443-0.6858j, 0.2525+0.6672j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4911, 0.5089]], grad_fn=<PowBackward0>)
loss:  0.6755093932151794
loss:  0.7007259130477905
loss:  0.054994065314531326
loss:  0.4715861678123474
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1639+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0819-0.j],
        [ 0.0819+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4153-0.3708j, 0.7030+0.4425j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3428+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7829-0.6221j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7829+0.6221j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4153-0.3708j, 0.7030+0.4425j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0944-0.5486j, 0.2751+0.7838j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3099, 0.6901]], grad_fn=<PowBackward0>)
loss:  0.37095907330513
loss:  0.49079668521881104
loss:  0.2685960531234741
loss:  0.4700482487678528
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1640+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0819-0.j],
        [ 0.0819+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5441-0.6704j, 0.3853+0.3257j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3427+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7830-0.6220j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7830+0.6220j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5441-0.6704j, 0.3853+0.3257j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0090-0.8634j, 0.0991+0.4947j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7455, 0.2545]], grad_fn=<PowBackward0>)
loss:  0.2937539219856262
loss:  0.27248695492744446
loss:  0.9871845245361328
loss:  0.3204506039619446
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1640+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0819-0.j],
        [ 0.0819+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5193-0.3694j, 0.6863+0.3504j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3425+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7830-0.6220j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7830+0.6220j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5193-0.3694j, 0.6863+0.3504j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1769-0.6122j, 0.3195+0.7013j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4061, 0.5939]], grad_fn=<PowBackward0>)
loss:  0.5210813283920288
loss:  0.31531861424446106
loss:  0.006737166550010443
loss:  0.5109873414039612
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1641+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.2977-0.2737j, 0.7843+0.4705j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3423+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7831-0.6219j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7831+0.6219j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2977-0.2737j, 0.7843+0.4705j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0629-0.3995j, 0.3216+0.8562j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1636, 0.8364]], grad_fn=<PowBackward0>)
loss:  0.17860130965709686
loss:  0.3080834746360779
loss:  0.6873692870140076
loss:  0.7250738143920898
----------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  ry
ry_matrix theta:  tensor([[0.1642+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6469-0.5857j, 0.4173+0.2537j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3421+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7832-0.6218j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7832+0.6218j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6469-0.5857j, 0.4173+0.2537j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1424-0.8609j, 0.1691+0.4582j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7615, 0.2385]], grad_fn=<PowBackward0>)
loss:  0.27251800894737244
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.40887799859046936
------------------------------Epoch18------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1642+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.5998-0.6732j, 0.3490+0.2555j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3421+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7832-0.6218j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7832+0.6218j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5998-0.6732j, 0.3490+0.2555j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0511-0.9002j, 0.1144+0.4171j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8129, 0.1871]], grad_fn=<PowBackward0>)
loss:  0.20710735023021698
loss:  0.47149351239204407
loss:  0.47006458044052124
loss:  0.2725250720977783
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1642+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5192-0.3694j, 0.6864+0.3504j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3420+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7832-0.6218j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7832+0.6218j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5192-0.3694j, 0.6864+0.3504j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1770-0.6122j, 0.3197+0.7012j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4061, 0.5939]], grad_fn=<PowBackward0>)
loss:  0.521006166934967
loss:  0.3708968162536621
loss:  0.27916350960731506
loss:  0.3204118311405182
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1643+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5318-0.6201j, 0.4457+0.3661j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3419+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7832-0.6217j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7832+0.6217j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5318-0.6201j, 0.4457+0.3661j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0310-0.8163j, 0.1215+0.5639j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6673, 0.3327]], grad_fn=<PowBackward0>)
loss:  0.40454810857772827
loss:  0.1345178484916687
loss:  0.42433029413223267
loss:  1.061155915260315
----------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  ry
ry_matrix theta:  tensor([[0.1643+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0820-0.j],
        [ 0.0820+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.3891-0.6875j, 0.3806+0.4806j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3418+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7833-0.6217j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7833+0.6217j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3891-0.6875j, 0.3806+0.4806j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1226-0.7804j, -0.0007+0.6131j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6241, 0.3759]], grad_fn=<PowBackward0>)
loss:  0.4714692533016205
loss:  1.1449207067489624
loss:  0.3008982539176941
loss:  0.520333468914032
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1643+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0821-0.j],
        [ 0.0821+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2443-0.2796j, 0.7550+0.5406j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3417+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7833-0.6216j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7833+0.6216j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2443-0.2796j, 0.7550+0.5406j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0176-0.3708j, 0.2553+0.8927j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1378, 0.8622]], grad_fn=<PowBackward0>)
loss:  0.14829212427139282
loss:  0.36262843012809753
loss:  0.1129780113697052
loss:  0.6518115401268005
----------index20----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9230+0.j, 0.3849+0.j]])
New state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1644+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0821-0.j],
        [ 0.0821+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6621-0.6343j, 0.3424+0.2052j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3416+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7833-0.6216j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7833+0.6216j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6621-0.6343j, 0.3424+0.2052j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1243-0.9084j, 0.1407+0.3736j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8406, 0.1594]], grad_fn=<PowBackward0>)
loss:  0.17358289659023285
loss:  0.9868986010551453
loss:  0.36353054642677307
loss:  0.3203798830509186
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1645+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0821-0.j],
        [ 0.0821+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4557-0.1664j, 0.8475+0.2154j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3415+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7834-0.6216j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7834+0.6216j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4557-0.1664j, 0.8475+0.2154j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2536-0.4136j, 0.5300+0.6955j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2354, 0.7646]], grad_fn=<PowBackward0>)
loss:  0.26834985613822937
loss:  0.22725187242031097
loss:  0.17855136096477509
loss:  0.3791654109954834
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1645+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0822-0.j],
        [ 0.0822+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7635-0.6048j, 0.2162+0.0677j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3414+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7834-0.6215j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7834+0.6215j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7635-0.6048j, 0.2162+0.0677j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2222-0.9483j, 0.1273+0.1874j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9487, 0.0513]], grad_fn=<PowBackward0>)
loss:  0.05267225205898285
loss:  0.3960168957710266
loss:  0.1432962417602539
loss:  0.6171292662620544
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1646+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0822-0.j],
        [ 0.0822+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3612-0.7595j, 0.3029+0.4483j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3413+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7834-0.6215j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7834+0.6215j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3612-0.7595j, 0.3029+0.4483j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1890-0.8195j, -0.0413+0.5394j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7073, 0.2927]], grad_fn=<PowBackward0>)
loss:  0.3462674021720886
loss:  0.32035592198371887
loss:  0.0067817531526088715
loss:  0.34352707862854004
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1646+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0822-0.j],
        [ 0.0822+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.1961-0.2615j, 0.7444+0.5822j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3412+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7835-0.6214j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7835+0.6214j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1961-0.2615j, 0.7444+0.5822j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0089-0.3267j,  0.2214+0.9188j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1068, 0.8932]], grad_fn=<PowBackward0>)
loss:  0.11297988146543503
loss:  1.0955991744995117
loss:  0.3280133903026581
loss:  0.43324801325798035
----------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  ry
ry_matrix theta:  tensor([[0.1647+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0823-0.j],
        [ 0.0823+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6081-0.5998j, 0.4310+0.2911j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3411+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7835-0.6214j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7835+0.6214j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6081-0.5998j, 0.4310+0.2911j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1038-0.8478j, 0.1568+0.4959j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7295, 0.2705]], grad_fn=<PowBackward0>)
loss:  0.3153953552246094
loss:  0.23146820068359375
loss:  0.594846248626709
loss:  0.2726074159145355
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1647+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0823-0.j],
        [ 0.0823+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.5576-0.3539j, 0.6833+0.3114j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3410+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7835-0.6214j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7835+0.6214j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5576-0.3539j, 0.6833+0.3114j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2170-0.6238j, 0.3419+0.6685j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4362, 0.5638]], grad_fn=<PowBackward0>)
loss:  0.5730677843093872
loss:  0.7247650623321533
loss:  0.1201995313167572
loss:  0.05512820929288864
----------index48----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1648+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0823-0.j],
        [ 0.0823+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5190-0.3695j, 0.6866+0.3503j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3409+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7836-0.6213j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7836+0.6213j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5190-0.3695j, 0.6866+0.3503j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1771-0.6120j, 0.3203+0.7010j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4059, 0.5941]], grad_fn=<PowBackward0>)
loss:  0.5207847952842712
loss:  0.6871920824050903
loss:  0.20713669061660767
loss:  0.5106547474861145
----------index52----------
train inputs:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1649+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0823-0.j],
        [ 0.0823+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5439-0.6706j, 0.3855+0.3254j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3408+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7836-0.6213j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7836+0.6213j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5439-0.6706j, 0.3855+0.3254j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0096-0.8634j, 0.0999+0.4945j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7455, 0.2545]], grad_fn=<PowBackward0>)
loss:  0.2937435209751129
loss:  0.30091580748558044
loss:  0.4906226098537445
loss:  0.6879722476005554
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1649+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.5670-0.4989j, 0.5551+0.3485j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3407+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7836-0.6212j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7836+0.6212j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5670-0.4989j, 0.5551+0.3485j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1344-0.7432j, 0.2184+0.6180j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5704, 0.4296]], grad_fn=<PowBackward0>)
loss:  0.8449589610099792
loss:  0.3593021333217621
loss:  0.6751536130905151
loss:  0.1736452281475067
----------index60----------
train inputs:  tensor([[0.6797, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1650+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6799-0.6447j, 0.3055+0.1697j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3406+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7836-0.6212j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7836+0.6212j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6799-0.6447j, 0.3055+0.1697j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1323-0.9276j, 0.1340+0.3228j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8779, 0.1221]], grad_fn=<PowBackward0>)
loss:  0.13025014102458954
loss:  0.006811278872191906
loss:  0.3301537036895752
loss:  0.03830403834581375
----------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  ry
ry_matrix theta:  tensor([[0.1650+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6209-0.3433j, 0.6552+0.2595j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3405+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7837-0.6212j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7837+0.6212j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6209-0.3433j, 0.6552+0.2595j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2734-0.6547j, 0.3523+0.6103j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5034, 0.4966]], grad_fn=<PowBackward0>)
loss:  0.7000025510787964
loss:  1.2944552898406982
loss:  0.12158214300870895
loss:  0.5729300379753113
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1650+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.5874-0.6243j, 0.4165+0.3029j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3404+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7837-0.6211j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7837+0.6211j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5874-0.6243j, 0.4165+0.3029j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0726-0.8541j, 0.1383+0.4961j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7348, 0.2652]], grad_fn=<PowBackward0>)
loss:  0.3081528842449188
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.4087199568748474
------------------------------Epoch19------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1651+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5108-0.6420j, 0.4285+0.3787j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3403+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7837-0.6211j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7837+0.6211j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5108-0.6420j, 0.4285+0.3787j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0015-0.8204j, 0.1006+0.5629j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6730, 0.3270]], grad_fn=<PowBackward0>)
loss:  0.3959987461566925
loss:  0.6751124262809753
loss:  0.34351682662963867
loss:  0.13026250898838043
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1651+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0824-0.j],
        [ 0.0824+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5207-0.1829j, 0.8092+0.2016j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3403+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7837-0.6211j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7837+0.6211j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5207-0.1829j, 0.8092+0.2016j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2945-0.4667j, 0.5090+0.6606j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3045, 0.6955]], grad_fn=<PowBackward0>)
loss:  0.363176167011261
loss:  0.5105513334274292
loss:  0.2726629972457886
loss:  0.11298301815986633
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1651+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8157+0.j, 0.5784+0.j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3402+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7837-0.6211j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7837+0.6211j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8157+0.j, 0.5784+0.j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.6393-0.5066j, 0.4533+0.3592j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6654, 0.3346]], grad_fn=<PowBackward0>)
loss:  1.0949604511260986
loss:  0.1346341073513031
loss:  0.4712284207344055
loss:  0.11298328638076782
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1651+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.7753-0.3533j, 0.5007+0.1528j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3402+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6211j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6211j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7753-0.3533j, 0.5007+0.1528j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3883-0.7584j, 0.2975+0.4308j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7259, 0.2741]], grad_fn=<PowBackward0>)
loss:  1.2943021059036255
loss:  0.4331757724285126
loss:  0.35931825637817383
loss:  0.4701228439807892
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1652+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3242-0.3132j, 0.7494+0.4850j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3401+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3242-0.3132j, 0.7494+0.4850j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0596-0.4468j, 0.2861+0.8455j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2032, 0.7968]], grad_fn=<PowBackward0>)
loss:  0.22717496752738953
loss:  0.37907764315605164
loss:  0.27267661690711975
loss:  0.327953577041626
----------index20----------
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  ry
ry_matrix theta:  tensor([[0.1652+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.3864-0.3532j, 0.7193+0.4567j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3401+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3864-0.3532j, 0.7193+0.4567j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0836-0.5168j, 0.2801+0.8047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2740, 0.7260]], grad_fn=<PowBackward0>)
loss:  0.3202624022960663
loss:  0.20715303719043732
loss:  0.5206379890441895
loss:  0.42413562536239624
----------index24----------
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  ry
ry_matrix theta:  tensor([[0.1652+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.4958-0.5904j, 0.4855+0.4123j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3400+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4958-0.5904j, 0.4855+0.4123j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0220-0.7706j, 0.1245+0.6246j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5943, 0.4057]], grad_fn=<PowBackward0>)
loss:  0.520329475402832
loss:  0.006830902770161629
loss:  0.5206307768821716
loss:  0.3202569782733917
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1652+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.0853-0.1741j, 0.7651+0.6141j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3400+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.0853-0.1741j, 0.7651+0.6141j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0412-0.1894j,  0.2183+0.9564j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0376, 0.9624]], grad_fn=<PowBackward0>)
loss:  0.03831431642174721
loss:  0.346059113740921
loss:  0.29373928904533386
loss:  0.8448514938354492
----------index32----------
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  ry
ry_matrix theta:  tensor([[0.1652+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6329-0.6964j, 0.2845+0.1832j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3400+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7838-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7838+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6329-0.6964j, 0.2845+0.1832j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0636-0.9389j, 0.1092+0.3202j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8855, 0.1145]], grad_fn=<PowBackward0>)
loss:  0.12159540504217148
loss:  0.40456292033195496
loss:  0.05519396811723709
loss:  0.36242252588272095
----------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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.3889-0.6878j, 0.3808+0.4803j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3399+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6210j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6210j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3889-0.6878j, 0.3808+0.4803j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1222-0.7806j,  0.0003+0.6130j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6243, 0.3757]], grad_fn=<PowBackward0>)
loss:  0.4711870849132538
loss:  0.6998319029808044
loss:  0.5729113221168518
loss:  0.3081699311733246
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0825-0.j],
        [ 0.0825+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6593-0.4386j, 0.5532+0.2587j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3399+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6209j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6209j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6593-0.4386j, 0.5532+0.2587j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2445-0.7532j, 0.2730+0.5463j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6271, 0.3729]], grad_fn=<PowBackward0>)
loss:  0.9863232374191284
loss:  0.2312544882297516
loss:  0.1203528642654419
loss:  0.7245001196861267
----------index44----------
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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6472-0.5476j, 0.4590+0.2656j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3398+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6209j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6209j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6472-0.5476j, 0.4590+0.2656j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1674-0.8311j, 0.1949+0.4932j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7188, 0.2812]], grad_fn=<PowBackward0>)
loss:  0.33022060990333557
loss:  0.687683641910553
loss:  0.006839184556156397
loss:  0.20715883374214172
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7634-0.6048j, 0.2165+0.0674j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3398+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6209j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6209j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7634-0.6048j, 0.2165+0.0674j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2229-0.9481j, 0.1278+0.1873j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9486, 0.0514]], grad_fn=<PowBackward0>)
loss:  0.052774544805288315
loss:  0.17368826270103455
loss:  0.3202393352985382
loss:  0.3154716491699219
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5660-0.6479j, 0.4014+0.3142j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3397+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6209j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6209j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5660-0.6479j, 0.4014+0.3142j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0414-0.8593j, 0.1196+0.4956j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7401, 0.2599]], grad_fn=<PowBackward0>)
loss:  0.300930380821228
loss:  0.17368961870670319
loss:  0.2679530084133148
loss:  0.6513744592666626
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4147-0.3711j, 0.7033+0.4423j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3397+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6209j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6209j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4147-0.3711j, 0.7033+0.4423j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0947-0.5484j, 0.2768+0.7834j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3097, 0.6903]], grad_fn=<PowBackward0>)
loss:  0.37069249153137207
loss:  0.6169507503509521
loss:  0.687053918838501
loss:  0.17844511568546295
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2439-0.2798j, 0.7551+0.5404j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3396+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7839-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7839+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2439-0.2798j, 0.7551+0.5404j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0175-0.3708j, 0.2564+0.8924j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1378, 0.8622]], grad_fn=<PowBackward0>)
loss:  0.1482532024383545
loss:  0.5946155190467834
loss:  0.5727699398994446
loss:  1.060147762298584
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.7690-0.2999j, 0.5454+0.1454j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3396+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7690-0.2999j, 0.5454+0.1454j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4167-0.7126j, 0.3373+0.4526j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6813, 0.3187]], grad_fn=<PowBackward0>)
loss:  1.1436398029327393
loss:  0.2793945074081421
loss:  0.49052780866622925
loss:  0.1432383954524994
----------index68----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3142-0.4014j, 0.6479+0.5660j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3142-0.4014j, 0.6479+0.5660j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0029-0.5098j,  0.1566+0.8459j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2599, 0.7401]], grad_fn=<PowBackward0>)
loss:  0.300933301448822
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.40865132212638855
------------------------------Epoch20------------------------------
--------------------Train--------------------
----------index0----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7634-0.6048j, 0.2165+0.0674j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7634-0.6048j, 0.2165+0.0674j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2230-0.9481j, 0.1279+0.1872j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.9486, 0.0514]], grad_fn=<PowBackward0>)
loss:  0.052789248526096344
loss:  0.3279242217540741
loss:  0.42408615350723267
loss:  0.13468000292778015
----------index4----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.8829-0.3271j, 0.3307+0.0639j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8829-0.3271j, 0.3307+0.0639j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4891-0.8046j, 0.2196+0.2554j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8866, 0.1134]], grad_fn=<PowBackward0>)
loss:  0.12039891630411148
loss:  0.1784350723028183
loss:  0.14323687553405762
loss:  0.3202212452888489
----------index8----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6347-0.3071j, 0.6700+0.2320j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6347-0.3071j, 0.6700+0.2320j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3070-0.6348j, 0.3813+0.5979j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4972, 0.5028]], grad_fn=<PowBackward0>)
loss:  0.6875863075256348
loss:  0.1303039938211441
loss:  0.35933950543403625
loss:  0.14825016260147095
----------index12----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.4957-0.5904j, 0.4855+0.4122j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4957-0.5904j, 0.4855+0.4122j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0221-0.7706j, 0.1247+0.6246j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5943, 0.4057]], grad_fn=<PowBackward0>)
loss:  0.5203282833099365
loss:  0.17370237410068512
loss:  0.6749857664108276
loss:  0.17370252311229706
----------index16----------
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  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3611-0.7597j, 0.3030+0.4479j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3611-0.7597j, 0.3030+0.4479j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1885-0.8197j, -0.0405+0.5393j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7075, 0.2925]], grad_fn=<PowBackward0>)
loss:  0.34598684310913086
loss:  0.8447812795639038
loss:  0.4711300730705261
loss:  1.293906331062317
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6667+0.j, 0.7454+0.j]])
New state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1654+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5188-0.3696j, 0.6867+0.3502j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5188-0.3696j, 0.6867+0.3502j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1773-0.6119j, 0.3210+0.7008j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4058, 0.5942]], grad_fn=<PowBackward0>)
loss:  0.520538866519928
loss:  0.7244170904159546
loss:  0.2937368154525757
loss:  0.32021796703338623
----------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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5107-0.6421j, 0.4286+0.3786j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3395+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5107-0.6421j, 0.4286+0.3786j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0018-0.8204j, 0.1010+0.5628j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6730, 0.3270]], grad_fn=<PowBackward0>)
loss:  0.39598411321640015
loss:  0.2727229595184326
loss:  0.32021716237068176
loss:  0.22713980078697205
----------index28----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.4553-0.1665j, 0.8477+0.2153j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4553-0.1665j, 0.8477+0.2153j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2536-0.4132j, 0.5310+0.6950j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2350, 0.7650]], grad_fn=<PowBackward0>)
loss:  0.2678931653499603
loss:  0.1216089278459549
loss:  0.2727241516113281
loss:  1.0944325923919678
----------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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5015-0.4571j, 0.6149+0.4018j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5015-0.4571j, 0.6149+0.4018j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1094-0.6696j, 0.2327+0.6968j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4604, 0.5396]], grad_fn=<PowBackward0>)
loss:  0.6169217228889465
loss:  0.6513116955757141
loss:  0.3081856667995453
loss:  0.5945751070976257
----------index36----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5239-0.4716j, 0.5959+0.3846j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5239-0.4716j, 0.5959+0.3846j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1180-0.6950j, 0.2285+0.6715j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4969, 0.5031]], grad_fn=<PowBackward0>)
loss:  0.6870201826095581
loss:  0.31549012660980225
loss:  0.30093520879745483
loss:  0.34350690245628357
----------index40----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0826-0.j],
        [ 0.0826+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.5574-0.3540j, 0.6835+0.3113j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5574-0.3540j, 0.6835+0.3113j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2172-0.6236j, 0.3426+0.6683j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4360, 0.5640]], grad_fn=<PowBackward0>)
loss:  0.5727142095565796
loss:  1.143517017364502
loss:  0.4045666754245758
loss:  0.3629445433616638
----------index44----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
----------Ansatz----------
Inside  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.5995-0.6734j, 0.3493+0.2551j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6208j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6208j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5995-0.6734j, 0.3493+0.2551j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0520-0.9001j, 0.1155+0.4169j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.8129, 0.1871]], grad_fn=<PowBackward0>)
loss:  0.20716732740402222
loss:  0.00685496861115098
loss:  0.03832639381289482
loss:  0.4711146950721741
----------index48----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4506-0.6674j, 0.4090+0.4292j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4506-0.6674j, 0.4090+0.4292j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0610-0.8030j,  0.0542+0.5904j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6485, 0.3515]], grad_fn=<PowBackward0>)
loss:  0.43311795592308044
loss:  0.11298595368862152
loss:  0.23116953670978546
loss:  0.5205177068710327
----------index52----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6593-0.4386j, 0.5533+0.2586j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6593-0.4386j, 0.5533+0.2586j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2446-0.7531j, 0.2733+0.5462j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6270, 0.3730]], grad_fn=<PowBackward0>)
loss:  0.9861633777618408
loss:  0.572891354560852
loss:  0.49050813913345337
loss:  0.20716814696788788
----------index56----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6665-0.5586j, 0.4306+0.2415j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6665-0.5586j, 0.4306+0.2415j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1758-0.8517j, 0.1877+0.4567j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7562, 0.2438]], grad_fn=<PowBackward0>)
loss:  0.27941879630088806
loss:  0.5103592872619629
loss:  0.0068569490686059
loss:  0.37065932154655457
----------index60----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7140-0.3791j, 0.5523+0.2036j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3394+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7140-0.3791j, 0.5523+0.2036j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3245-0.7405j, 0.3066+0.5024j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6535, 0.3465]], grad_fn=<PowBackward0>)
loss:  1.0600143671035767
loss:  0.36235854029655457
loss:  0.47014620900154114
loss:  0.055235035717487335
----------index64----------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4030-0.3912j, 0.6835+0.4662j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4030-0.3912j, 0.6835+0.4662j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0731-0.5569j, 0.2466+0.7898j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3155, 0.6845]], grad_fn=<PowBackward0>)
loss:  0.37902817130088806
loss:  0.11298622190952301
loss:  0.330270379781723
loss:  0.300936758518219
----------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  ry
ry_matrix theta:  tensor([[0.1655+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6208-0.3434j, 0.6553+0.2594j]], grad_fn=<PermuteBackward0>)
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]], grad_fn=<ToCopyBackward0>)
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6208-0.3434j, 0.6553+0.2594j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2736-0.6545j, 0.3528+0.6102j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5032, 0.4968]], grad_fn=<PowBackward0>)
loss:  0.6996549367904663
--------------------Validation--------------------
valid set accuracy: 0.9655172228813171
valid set loss: 0.4086320996284485
--------------------Test--------------------
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5239-0.4716j, 0.5959+0.3846j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5239-0.4716j, 0.5959+0.3846j]])
New state:  tensor([[0.1180-0.6950j, 0.2285+0.6715j]])
----------Measure----------
Probability:  tensor([[0.4969, 0.5031]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
New state:  tensor([[0.6065-0.3761j, 0.6403+0.2841j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6065-0.3761j, 0.6403+0.2841j]])
New state:  tensor([[0.2420-0.6714j, 0.3256+0.6202j]])
----------Measure----------
Probability:  tensor([[0.5093, 0.4907]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
New state:  tensor([[0.3649-0.6132j, 0.4474+0.5391j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.3649-0.6132j, 0.4474+0.5391j]])
New state:  tensor([[-0.0946-0.7073j,  0.0162+0.7004j]])
----------Measure----------
Probability:  tensor([[0.5092, 0.4908]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
New state:  tensor([[0.2017-0.2496j, 0.7674+0.5550j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.2017-0.2496j, 0.7674+0.5550j]])
New state:  tensor([[0.0032-0.3209j, 0.2572+0.9115j]])
----------Measure----------
Probability:  tensor([[0.1030, 0.8970]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6466-0.5859j, 0.4178+0.2533j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6466-0.5859j, 0.4178+0.2533j]])
New state:  tensor([[0.1433-0.8607j, 0.1703+0.4579j]])
----------Measure----------
Probability:  tensor([[0.7613, 0.2387]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
New state:  tensor([[0.5960-0.3335j, 0.6779+0.2720j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5960-0.3335j, 0.6779+0.2720j]])
New state:  tensor([[0.2603-0.6314j, 0.3627+0.6340j]])
----------Measure----------
Probability:  tensor([[0.4664, 0.5336]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
New state:  tensor([[0.7171-0.6626j, 0.2034+0.0738j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.7171-0.6626j, 0.2034+0.0738j]])
New state:  tensor([[0.1509-0.9646j, 0.1137+0.1841j]])
----------Measure----------
Probability:  tensor([[0.9532, 0.0468]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4567-0.7193j, 0.3532+0.3863j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4567-0.7193j, 0.3532+0.3863j]])
New state:  tensor([[-0.0885-0.8475j,  0.0372+0.5221j]])
----------Measure----------
Probability:  tensor([[0.7260, 0.2740]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6347-0.3071j, 0.6701+0.2320j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6347-0.3071j, 0.6701+0.2320j]])
New state:  tensor([[0.3070-0.6348j, 0.3813+0.5978j]])
----------Measure----------
Probability:  tensor([[0.4972, 0.5028]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.6856-0.5691j, 0.3995+0.2156j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6856-0.5691j, 0.3995+0.2156j]])
New state:  tensor([[0.1843-0.8718j, 0.1794+0.4170j]])
----------Measure----------
Probability:  tensor([[0.7939, 0.2061]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
New state:  tensor([[0.4348-0.6506j, 0.4258+0.4542j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4348-0.6506j, 0.4258+0.4542j]])
New state:  tensor([[-0.0630-0.7800j,  0.0519+0.6205j]])
----------Measure----------
Probability:  tensor([[0.6123, 0.3877]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.4957-0.5904j, 0.4855+0.4122j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4957-0.5904j, 0.4855+0.4122j]])
New state:  tensor([[0.0222-0.7706j, 0.1248+0.6246j]])
----------Measure----------
Probability:  tensor([[0.5943, 0.4057]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5302-0.4088j, 0.6501+0.3594j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5302-0.4088j, 0.6501+0.3594j]])
New state:  tensor([[0.1619-0.6496j, 0.2866+0.6853j]])
----------Measure----------
Probability:  tensor([[0.4482, 0.5518]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5437-0.6707j, 0.3857+0.3252j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5437-0.6707j, 0.3857+0.3252j]])
New state:  tensor([[0.0100-0.8633j, 0.1006+0.4944j]])
----------Measure----------
Probability:  tensor([[0.7455, 0.2545]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
New state:  tensor([[0.4267-0.4665j, 0.6111+0.4763j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4267-0.4665j, 0.6111+0.4763j]])
New state:  tensor([[0.0450-0.6306j, 0.1835+0.7528j]])
----------Measure----------
Probability:  tensor([[0.3997, 0.6003]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
New state:  tensor([[0.6651-0.5969j, 0.3876+0.2261j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6651-0.5969j, 0.3876+0.2261j]])
New state:  tensor([[0.1510-0.8808j, 0.1635+0.4179j]])
----------Measure----------
Probability:  tensor([[0.7987, 0.2013]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4260-0.3499j, 0.7226+0.4169j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4260-0.3499j, 0.7226+0.4169j]])
New state:  tensor([[0.1168-0.5388j, 0.3078+0.7754j]])
----------Measure----------
Probability:  tensor([[0.3040, 0.6960]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
New state:  tensor([[0.1608-0.1909j, 0.8233+0.5097j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.1608-0.1909j, 0.8233+0.5097j]])
New state:  tensor([[0.0075-0.2495j, 0.3291+0.9107j]])
----------Measure----------
Probability:  tensor([[0.0623, 0.9377]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
New state:  tensor([[0.2959-0.7203j, 0.3124+0.5441j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.2959-0.7203j, 0.3124+0.5441j]])
New state:  tensor([[-0.2151-0.7484j, -0.0928+0.6205j]])
----------Measure----------
Probability:  tensor([[0.6063, 0.3937]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
New state:  tensor([[0.5821-0.7445j, 0.2618+0.1957j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.7445j, 0.2618+0.1957j]])
New state:  tensor([[-0.0057-0.9451j,  0.0838+0.3159j]])
----------Measure----------
Probability:  tensor([[0.8932, 0.1068]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
New state:  tensor([[0.5489-0.6344j, 0.4245+0.3407j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5489-0.6344j, 0.4245+0.3407j]])
New state:  tensor([[0.0365-0.8381j, 0.1214+0.5306j]])
----------Measure----------
Probability:  tensor([[0.7037, 0.2963]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5273-0.6567j, 0.4079+0.3526j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5273-0.6567j, 0.4079+0.3526j]])
New state:  tensor([[0.0058-0.8422j, 0.1009+0.5297j]])
----------Measure----------
Probability:  tensor([[0.7093, 0.2907]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
New state:  tensor([[0.6484-0.2660j, 0.6845+0.2009j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6484-0.2660j, 0.6845+0.2009j]])
New state:  tensor([[0.3432-0.6110j, 0.4119+0.5824j]])
----------Measure----------
Probability:  tensor([[0.4911, 0.5089]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
New state:  tensor([[0.5206-0.6927j, 0.3693+0.3358j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5206-0.6927j, 0.3693+0.3358j]])
New state:  tensor([[-0.0218-0.8662j,  0.0811+0.4925j]])
----------Measure----------
Probability:  tensor([[0.7508, 0.2492]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
New state:  tensor([[0.2107-0.7081j, 0.2583+0.6225j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.2107-0.7081j, 0.2583+0.6225j]])
New state:  tensor([[-0.2744-0.6859j, -0.1839+0.6484j]])
----------Measure----------
Probability:  tensor([[0.5458, 0.4542]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.6856-0.5691j, 0.3995+0.2156j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.6856-0.5691j, 0.3995+0.2156j]])
New state:  tensor([[0.1843-0.8718j, 0.1794+0.4170j]])
----------Measure----------
Probability:  tensor([[0.7939, 0.2061]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
New state:  tensor([[0.4655-0.3422j, 0.7239+0.3770j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.4655-0.3422j, 0.7239+0.3770j]])
New state:  tensor([[0.1526-0.5573j, 0.3335+0.7449j]])
----------Measure----------
Probability:  tensor([[0.3338, 0.6662]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5660-0.6479j, 0.4015+0.3142j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5660-0.6479j, 0.4015+0.3142j]])
New state:  tensor([[0.0415-0.8593j, 0.1198+0.4955j]])
----------Measure----------
Probability:  tensor([[0.7401, 0.2599]])
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  ry
ry_matrix theta:  tensor([[0.1655+0.j]])
ry_matrix:  tensor([[ 0.9966-0.j, -0.0827-0.j],
        [ 0.0827+0.j,  0.9966-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
New state:  tensor([[0.5160-0.4336j, 0.6328+0.3812j]])
Inside  rz
rz_matrix theta:  tensor([[1.3393+0.j]])
rz_matrix:  tensor([[0.7840-0.6207j, 0.0000+0.0000j],
        [0.0000+0.0000j, 0.7840+0.6207j]])
Performing matrix multiplication

Current state:  tensor([[0.5160-0.4336j, 0.6328+0.3812j]])
New state:  tensor([[0.1354-0.6603j, 0.2595+0.6916j]])
----------Measure----------
Probability:  tensor([[0.4543, 0.5457]])
test set accuracy: 0.9655172228813171
test set loss: 0.40863215923309326
