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

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4658-0.3255j, 0.6705+0.4769j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6853+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6655-0.j, -0.7464-0.j],
        [ 0.7464+0.j,  0.6655-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4658-0.3255j, 0.6705+0.4769j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1905-0.5726j,  0.7939+0.0745j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3641, 0.6359]], grad_fn=<PowBackward0>)
loss:  0.4527498185634613
loss:  0.7630837559700012
loss:  0.15921518206596375
loss:  0.39906421303749084
----------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  rx
rx_matrix theta:  tensor([[-0.0216+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0108j],
        [0.0000+0.0108j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6756-0.5590j, 0.3689+0.3082j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6835+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6662-0.j, -0.7458-0.j],
        [ 0.7458+0.j,  0.6662-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6756-0.5590j, 0.3689+0.3082j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1749-0.6022j, 0.7497-0.2116j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3933, 0.6067]], grad_fn=<PowBackward0>)
loss:  0.9332786798477173
loss:  0.49264025688171387
loss:  0.8611927032470703
loss:  0.81094890832901
----------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  rx
rx_matrix theta:  tensor([[-0.0215+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0108j],
        [0.0000+0.0108j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5058-0.6620j, 0.3384+0.4374j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6817+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6668-0.j, -0.7452-0.j],
        [ 0.7452+0.j,  0.6668-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5058-0.6620j, 0.3384+0.4374j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0851-0.7674j, 0.6026-0.2017j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5962, 0.4038]], grad_fn=<PowBackward0>)
loss:  0.5172421932220459
loss:  0.46260765194892883
loss:  0.5003851652145386
loss:  0.2944720983505249
----------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  rx
rx_matrix theta:  tensor([[-0.0217+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0108j],
        [0.0000+0.0108j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.8000-0.5648j, 0.1633+0.1198j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6801+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6674-0.j, -0.7447-0.j],
        [ 0.7447+0.j,  0.6674-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8000-0.5648j, 0.1633+0.1198j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4123-0.4662j, 0.7047-0.3407j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3874, 0.6126]], grad_fn=<PowBackward0>)
loss:  0.9484193325042725
loss:  0.5932825207710266
loss:  0.21439839899539948
loss:  0.5977393388748169
----------index16----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6966-0.5326j, 0.3799+0.2945j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6786+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6680-0.j, -0.7442-0.j],
        [ 0.7442+0.j,  0.6680-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6966-0.5326j, 0.3799+0.2945j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1826-0.5749j, 0.7722-0.1996j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3639, 0.6361]], grad_fn=<PowBackward0>)
loss:  1.010859489440918
loss:  0.5460547208786011
loss:  0.8580169677734375
loss:  1.0149753093719482
----------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  rx
rx_matrix theta:  tensor([[-0.0223+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0112j],
        [0.0000+0.0112j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4130-0.6418j, 0.3546+0.5401j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6770+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6686-0.j, -0.7436-0.j],
        [ 0.7436+0.j,  0.6686-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4130-0.6418j, 0.3546+0.5401j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0124-0.8307j, 0.5442-0.1162j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6903, 0.3097]], grad_fn=<PowBackward0>)
loss:  0.37062883377075195
loss:  1.374897837638855
loss:  0.35753926634788513
loss:  0.29815474152565
----------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  rx
rx_matrix theta:  tensor([[-0.0231+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0115j],
        [0.0000+0.0115j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5997-0.5775j, 0.3986+0.3846j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6754+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6692-0.j, -0.7431-0.j],
        [ 0.7431+0.j,  0.6692-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5997-0.5775j, 0.3986+0.3846j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1050-0.6723j, 0.7124-0.1718j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4630, 0.5370]], grad_fn=<PowBackward0>)
loss:  0.7699928283691406
loss:  0.6603280901908875
loss:  0.45389556884765625
loss:  0.1447124183177948
----------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  rx
rx_matrix theta:  tensor([[-0.0234+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0117j],
        [0.0000+0.0117j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6513-0.6761j, 0.2392+0.2477j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6740+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6697-0.j, -0.7426-0.j],
        [ 0.7426+0.j,  0.6697-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6513-0.6761j, 0.2392+0.2477j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2585-0.6367j, 0.6439-0.3363j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4723, 0.5277]], grad_fn=<PowBackward0>)
loss:  0.7501620054244995
loss:  0.40581023693084717
loss:  0.6589916348457336
loss:  0.14740367233753204
----------index32----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6227-0.6465j, 0.3062+0.3172j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6726+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6702-0.j, -0.7422-0.j],
        [ 0.7422+0.j,  0.6702-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6227-0.6465j, 0.3062+0.3172j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1901-0.6687j, 0.6674-0.2672j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4832, 0.5168]], grad_fn=<PowBackward0>)
loss:  0.7272276282310486
loss:  0.7118794322013855
loss:  0.6898338794708252
loss:  0.6328926682472229
----------index36----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5392-0.6040j, 0.3920+0.4367j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6713+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6707-0.j, -0.7417-0.j],
        [ 0.7417+0.j,  0.6707-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5392-0.6040j, 0.3920+0.4367j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0709-0.7290j, 0.6629-0.1551j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5365, 0.4635]], grad_fn=<PowBackward0>)
loss:  0.622677206993103
loss:  0.9248300194740295
loss:  0.8472147583961487
loss:  0.7066250443458557
----------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  rx
rx_matrix theta:  tensor([[-0.0243+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0122j],
        [0.0000+0.0122j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4913-0.3435j, 0.6521+0.4641j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6699+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6712-0.j, -0.7412-0.j],
        [ 0.7412+0.j,  0.6712-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4913-0.3435j, 0.6521+0.4641j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1536-0.5746j,  0.8019+0.0569j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3537, 0.6463]], grad_fn=<PowBackward0>)
loss:  0.4365401566028595
loss:  0.45817118883132935
loss:  0.29407986998558044
loss:  0.6728515028953552
----------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  rx
rx_matrix theta:  tensor([[-0.0252+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0126j],
        [0.0000+0.0126j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7230-0.5985j, 0.2642+0.2219j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6685+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6717-0.j, -0.7408-0.j],
        [ 0.7408+0.j,  0.6717-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7230-0.5985j, 0.2642+0.2219j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2900-0.5664j, 0.7131-0.2943j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4049, 0.5951]], grad_fn=<PowBackward0>)
loss:  0.9040554761886597
loss:  0.31246060132980347
loss:  0.4685012996196747
loss:  0.25686872005462646
----------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  rx
rx_matrix theta:  tensor([[-0.0259+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0130j],
        [0.0000+0.0130j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1400-0.1130j, 0.7569+0.6282j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6671+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6722-0.j, -0.7403-0.j],
        [ 0.7403+0.j,  0.6722-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1400-0.1130j, 0.7569+0.6282j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4663-0.5411j,  0.6125+0.3386j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5102, 0.4898]], grad_fn=<PowBackward0>)
loss:  0.7137009501457214
loss:  0.04157555475831032
loss:  0.8977249264717102
loss:  0.503078281879425
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3545-0.2243j, 0.7602+0.4960j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6658+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6727-0.j, -0.7399-0.j],
        [ 0.7399+0.j,  0.6727-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3545-0.2243j, 0.7602+0.4960j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3240-0.5179j,  0.7737+0.1677j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3732, 0.6268]], grad_fn=<PowBackward0>)
loss:  0.4671063721179962
loss:  0.6409072875976562
loss:  0.7919549942016602
loss:  0.2631562352180481
----------index56----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4119-0.6411j, 0.3559+0.5409j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6642+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6733-0.j, -0.7394-0.j],
        [ 0.7394+0.j,  0.6733-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4119-0.6411j, 0.3559+0.5409j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0142-0.8316j, 0.5442-0.1098j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6918, 0.3082]], grad_fn=<PowBackward0>)
loss:  0.36850035190582275
loss:  0.20287831127643585
loss:  0.2036813199520111
loss:  0.31192371249198914
----------index60----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6222-0.6460j, 0.3071+0.3181j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6630+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6738-0.j, -0.7390-0.j],
        [ 0.7390+0.j,  0.6738-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6222-0.6460j, 0.3071+0.3181j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1923-0.6703j, 0.6667-0.2631j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4863, 0.5137]], grad_fn=<PowBackward0>)
loss:  0.7209720015525818
loss:  0.770462155342102
loss:  0.48250246047973633
loss:  0.300825297832489
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6619+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6742-0.j, -0.7386-0.j],
        [ 0.7386+0.j,  0.6742-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0838-0.7919j, 0.5713-0.1988j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6341, 0.3659]], grad_fn=<PowBackward0>)
loss:  0.4555669128894806
loss:  0.20216743648052216
loss:  0.844587504863739
loss:  0.10823768377304077
----------index68----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4380-0.3052j, 0.6890+0.4902j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6607+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6746-0.j, -0.7382-0.j],
        [ 0.7382+0.j,  0.6746-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4380-0.3052j, 0.6890+0.4902j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2131-0.5677j,  0.7881+0.1054j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3677, 0.6323]], grad_fn=<PowBackward0>)
loss:  0.458408921957016
--------------------Validation--------------------
valid set accuracy: 0.7586206793785095
valid set loss: 0.5283846259117126
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5610-0.5826j, 0.4084+0.4232j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6604+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6747-0.j, -0.7381-0.j],
        [ 0.7381+0.j,  0.6747-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5610-0.5826j, 0.4084+0.4232j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0771-0.7054j, 0.6896-0.1444j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5036, 0.4964]], grad_fn=<PowBackward0>)
loss:  0.6859771013259888
loss:  0.5094971060752869
loss:  0.1597098559141159
loss:  1.0037201642990112
----------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  rx
rx_matrix theta:  tensor([[-0.0267+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6056-0.4617j, 0.5127+0.3966j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6592+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6752-0.j, -0.7377-0.j],
        [ 0.7377+0.j,  0.6752-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6056-0.4617j, 0.5127+0.3966j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0307-0.6042j, 0.7929-0.0728j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3661, 0.6339]], grad_fn=<PowBackward0>)
loss:  0.45579975843429565
loss:  0.10784616321325302
loss:  0.5796856880187988
loss:  0.2189294397830963
----------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  rx
rx_matrix theta:  tensor([[-0.0268+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5447-0.4146j, 0.5770+0.4456j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6581+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6756-0.j, -0.7373-0.j],
        [ 0.7373+0.j,  0.6756-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5447-0.4146j, 0.5770+0.4456j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0574-0.6086j,  0.7914-0.0047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3737, 0.6263]], grad_fn=<PowBackward0>)
loss:  0.46791791915893555
loss:  1.3454333543777466
loss:  0.356476753950119
loss:  0.5003339648246765
----------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  rx
rx_matrix theta:  tensor([[-0.0265+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0133j],
        [0.0000+0.0133j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6569+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6760-0.j, -0.7369-0.j],
        [ 0.7369+0.j,  0.6760-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0851-0.7924j, 0.5711-0.1968j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6351, 0.3649]], grad_fn=<PowBackward0>)
loss:  0.45396023988723755
loss:  0.36740660667419434
loss:  0.26218387484550476
loss:  0.7821142077445984
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5207-0.1375j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6557+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6765-0.j, -0.7365-0.j],
        [ 0.7365+0.j,  0.6765-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5207-0.1375j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2436-0.2662j,  0.9308+0.0579j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1302, 0.8698]], grad_fn=<PowBackward0>)
loss:  0.13952922821044922
loss:  0.7668527364730835
loss:  0.4863179326057434
loss:  0.9936726689338684
----------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  rx
rx_matrix theta:  tensor([[-0.0266+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0133j],
        [0.0000+0.0133j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8606+0.0068j, 0.5091+0.0114j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6543+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6770-0.j, -0.7360-0.j],
        [ 0.7360+0.j,  0.6770-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8606+0.0068j, 0.5091+0.0114j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2079-0.0038j, 0.9781+0.0127j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0432, 0.9568]], grad_fn=<PowBackward0>)
loss:  0.04418128356337547
loss:  0.8388504981994629
loss:  0.698715329170227
loss:  0.7148622870445251
----------index24----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0091+0.0101j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6530+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6775-0.j, -0.7355-0.j],
        [ 0.7355+0.j,  0.6775-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0091+0.0101j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.5543-0.4834j,  0.4982+0.4591j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5410, 0.4590]], grad_fn=<PowBackward0>)
loss:  0.7787389159202576
loss:  0.7602648138999939
loss:  0.6166921854019165
loss:  0.31061121821403503
----------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  rx
rx_matrix theta:  tensor([[-0.0281+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0140j],
        [0.0000+0.0140j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6985-0.4087j, 0.5027+0.3038j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6513+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6781-0.j, -0.7350-0.j],
        [ 0.7350+0.j,  0.6781-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6985-0.4087j, 0.5027+0.3038j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1042-0.5004j, 0.8543-0.0944j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2613, 0.7387]], grad_fn=<PowBackward0>)
loss:  0.3028605282306671
loss:  0.9148217439651489
loss:  0.5289084315299988
loss:  0.641521155834198
----------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3302-0.5683j, 0.3877+0.6463j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6497+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6787-0.j, -0.7345-0.j],
        [ 0.7345+0.j,  0.6787-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3302-0.5683j, 0.3877+0.6463j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0606-0.8603j,  0.5057+0.0212j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7439, 0.2561]], grad_fn=<PowBackward0>)
loss:  0.29589375853538513
loss:  0.9103662371635437
loss:  0.2041042596101761
loss:  0.8353254795074463
----------index36----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4112-0.6406j, 0.3568+0.5415j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6482+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6792-0.j, -0.7339-0.j],
        [ 0.7339+0.j,  0.6792-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4112-0.6406j, 0.3568+0.5415j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0174-0.8325j, 0.5441-0.1024j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6934, 0.3066]], grad_fn=<PowBackward0>)
loss:  0.3661024868488312
loss:  0.441858172416687
loss:  0.7287391424179077
loss:  0.30069854855537415
----------index40----------
train inputs:  tensor([[2.2519, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.2519]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.2519+0.j]])
ry_matrix:  tensor([[ 0.4303-0.j, -0.9027-0.j],
        [ 0.9027+0.j,  0.4303-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3537-0.2230j, 0.7606+0.4966j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6468+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6797-0.j, -0.7335-0.j],
        [ 0.7335+0.j,  0.6797-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3537-0.2230j, 0.7606+0.4966j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3175-0.5159j,  0.7764+0.1740j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3669, 0.6331]], grad_fn=<PowBackward0>)
loss:  0.45711299777030945
loss:  0.8289554119110107
loss:  0.4058370888233185
loss:  0.25554022192955017
----------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  rx
rx_matrix theta:  tensor([[-0.0298+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0149j],
        [0.0000+0.0149j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4776-0.6802j, 0.3244+0.4516j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6454+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6803-0.j, -0.7330-0.j],
        [ 0.7330+0.j,  0.6803-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4776-0.6802j, 0.3244+0.4516j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0871-0.7937j, 0.5708-0.1913j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6376, 0.3624]], grad_fn=<PowBackward0>)
loss:  0.4500837028026581
loss:  0.7095375657081604
loss:  0.3098781108856201
loss:  0.4307694733142853
----------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  rx
rx_matrix theta:  tensor([[-0.0300+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0150j],
        [0.0000+0.0150j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3576-0.3440j, 0.6250+0.6026j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6440+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6807-0.j, -0.7325-0.j],
        [ 0.7325+0.j,  0.6807-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3576-0.3440j, 0.6250+0.6026j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2143-0.6756j,  0.6874+0.1583j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5024, 0.4976]], grad_fn=<PowBackward0>)
loss:  0.6979159712791443
loss:  0.45250004529953003
loss:  0.8303400278091431
loss:  0.387706995010376
----------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  rx
rx_matrix theta:  tensor([[-0.0298+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0149j],
        [0.0000+0.0149j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1388-0.1116j, 0.7572+0.6285j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6426+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6813-0.j, -0.7320-0.j],
        [ 0.7320+0.j,  0.6813-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1388-0.1116j, 0.7572+0.6285j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4597-0.5361j,  0.6174+0.3465j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4987, 0.5013]], grad_fn=<PowBackward0>)
loss:  0.690598726272583
loss:  0.20948922634124756
loss:  0.6215661764144897
loss:  0.6681830883026123
----------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  rx
rx_matrix theta:  tensor([[-0.0297+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0148j],
        [0.0000+0.0148j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7225-0.5979j, 0.2655+0.2235j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6412+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6818-0.j, -0.7316-0.j],
        [ 0.7316+0.j,  0.6818-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7225-0.5979j, 0.2655+0.2235j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2984-0.5711j, 0.7096-0.2850j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4152, 0.5848]], grad_fn=<PowBackward0>)
loss:  0.8788992166519165
loss:  0.8695319890975952
loss:  0.2870427668094635
loss:  0.904272198677063
----------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  rx
rx_matrix theta:  tensor([[-0.0300+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0150j],
        [0.0000+0.0150j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8088-0.2796j, 0.4843+0.1819j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6396+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6824-0.j, -0.7310-0.j],
        [ 0.7310+0.j,  0.6824-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8088-0.2796j, 0.4843+0.1819j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1979-0.3238j, 0.9217-0.0803j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1440, 0.8560]], grad_fn=<PowBackward0>)
loss:  0.15547242760658264
loss:  0.593657910823822
loss:  0.6330446600914001
loss:  0.4801977276802063
----------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  rx
rx_matrix theta:  tensor([[-0.0305+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4135-0.4298j, 0.5572+0.5777j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6382+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6829-0.j, -0.7305-0.j],
        [ 0.7305+0.j,  0.6829-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4135-0.4298j, 0.5572+0.5777j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1247-0.7156j,  0.6826+0.0806j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5276, 0.4724]], grad_fn=<PowBackward0>)
loss:  0.7498382925987244
loss:  0.4628225564956665
loss:  0.19419588148593903
loss:  0.6282773017883301
----------index68----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4993-0.3791j, 0.6167+0.4761j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6368+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6834-0.j, -0.7301-0.j],
        [ 0.7301+0.j,  0.6834-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4993-0.3791j, 0.6167+0.4761j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1090-0.6067j,  0.7859+0.0486j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3799, 0.6201]], grad_fn=<PowBackward0>)
loss:  0.4779490828514099
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5202982425689697
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0304+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6067-0.3174j, 0.6399+0.3487j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6365+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6835-0.j, -0.7299-0.j],
        [ 0.7299+0.j,  0.6835-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6067-0.3174j, 0.6399+0.3487j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0524-0.4715j,  0.8803+0.0066j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2251, 0.7749]], grad_fn=<PowBackward0>)
loss:  0.25496241450309753
loss:  0.04812166467308998
loss:  0.9016512632369995
loss:  0.3643653690814972
----------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  rx
rx_matrix theta:  tensor([[-0.0303+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0151j],
        [0.0000+0.0151j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3535-0.2228j, 0.7607+0.4968j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6354+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6839-0.j, -0.7296-0.j],
        [ 0.7296+0.j,  0.6839-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3535-0.2228j, 0.7607+0.4968j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3132-0.5148j,  0.7781+0.1772j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3631, 0.6369]], grad_fn=<PowBackward0>)
loss:  0.4511314630508423
loss:  0.7530739307403564
loss:  0.21175743639469147
loss:  0.8235844969749451
----------index8----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6216-0.6454j, 0.3085+0.3194j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6344+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6843-0.j, -0.7292-0.j],
        [ 0.7292+0.j,  0.6843-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6216-0.6454j, 0.3085+0.3194j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2004-0.6745j, 0.6643-0.2521j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4951, 0.5049]], grad_fn=<PowBackward0>)
loss:  0.7029550075531006
loss:  0.10329519212245941
loss:  0.3005371391773224
loss:  0.6774902939796448
----------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  rx
rx_matrix theta:  tensor([[-0.0307+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0154j],
        [0.0000+0.0154j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6362-0.5679j, 0.3883+0.3493j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6332+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6847-0.j, -0.7288-0.j],
        [ 0.7288+0.j,  0.6847-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6362-0.5679j, 0.3883+0.3493j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1526-0.6434j, 0.7295-0.1748j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4372, 0.5628]], grad_fn=<PowBackward0>)
loss:  0.8273133635520935
loss:  0.7572440505027771
loss:  0.4280363917350769
loss:  0.6107603907585144
----------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  rx
rx_matrix theta:  tensor([[-0.0311+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2966-0.2228j, 0.7359+0.5664j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6319+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6852-0.j, -0.7284-0.j],
        [ 0.7284+0.j,  0.6852-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2966-0.2228j, 0.7359+0.5664j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3328-0.5652j,  0.7203+0.2258j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4302, 0.5698]], grad_fn=<PowBackward0>)
loss:  0.5624906420707703
loss:  0.6275603175163269
loss:  0.6881590485572815
loss:  0.28480198979377747
----------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  rx
rx_matrix theta:  tensor([[-0.0314+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0157j],
        [0.0000+0.0157j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6952-0.5308j, 0.3824+0.2978j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6304+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6857-0.j, -0.7279-0.j],
        [ 0.7279+0.j,  0.6857-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6952-0.5308j, 0.3824+0.2978j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1984-0.5807j, 0.7683-0.1821j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3766, 0.6234]], grad_fn=<PowBackward0>)
loss:  0.9765514731407166
loss:  0.19178570806980133
loss:  0.499194473028183
loss:  0.36347001791000366
----------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  rx
rx_matrix theta:  tensor([[-0.0318+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0159j],
        [0.0000+0.0159j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5268-0.5472j, 0.4517+0.4681j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6289+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6863-0.j, -0.7274-0.j],
        [ 0.7274+0.j,  0.6863-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5268-0.5472j, 0.4517+0.4681j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0330-0.7160j, 0.6931-0.0768j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5137, 0.4863]], grad_fn=<PowBackward0>)
loss:  0.666118860244751
loss:  0.4806762933731079
loss:  0.7533629536628723
loss:  0.616442859172821
----------index28----------
train inputs:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6837-0.2768j, 0.6199+0.2678j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6276+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6867-0.j, -0.7269-0.j],
        [ 0.7269+0.j,  0.6867-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6837-0.2768j, 0.6199+0.2678j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0189-0.3848j, 0.9227-0.0173j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1484, 0.8516]], grad_fn=<PowBackward0>)
loss:  0.16062889993190765
loss:  0.8178634643554688
loss:  0.4762525260448456
loss:  0.4912254214286804
----------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  rx
rx_matrix theta:  tensor([[-0.0333+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6777-0.5170j, 0.4127+0.3212j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6264+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6872-0.j, -0.7265-0.j],
        [ 0.7265+0.j,  0.6872-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6777-0.5170j, 0.4127+0.3212j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1659-0.5886j, 0.7759-0.1549j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3740, 0.6260]], grad_fn=<PowBackward0>)
loss:  0.9835558533668518
loss:  0.7499054074287415
loss:  0.4741190969944
loss:  0.8946093916893005
----------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  rx
rx_matrix theta:  tensor([[-0.0338+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5642-0.4289j, 0.5579+0.4319j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6248+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6878-0.j, -0.7259-0.j],
        [ 0.7259+0.j,  0.6878-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5642-0.4289j, 0.5579+0.4319j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0170-0.6085j,  0.7933-0.0143j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3705, 0.6295]], grad_fn=<PowBackward0>)
loss:  0.4628761410713196
loss:  0.25885748863220215
loss:  0.44571125507354736
loss:  0.3082555830478668
----------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  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0170j],
        [0.0000+0.0170j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5673-0.3285j, 0.6472+0.3892j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6234+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6882-0.j, -0.7255-0.j],
        [ 0.7255+0.j,  0.6882-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5673-0.3285j, 0.6472+0.3892j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0791-0.5085j,  0.8569+0.0295j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2648, 0.7352]], grad_fn=<PowBackward0>)
loss:  0.30758702754974365
loss:  0.8089216947555542
loss:  0.8833911418914795
loss:  0.44278162717819214
----------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  rx
rx_matrix theta:  tensor([[-0.0340+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0170j],
        [0.0000+0.0170j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6041-0.4598j, 0.5144+0.3988j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6221+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6887-0.j, -0.7250-0.j],
        [ 0.7250+0.j,  0.6887-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.4598j, 0.5144+0.3988j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0432-0.6058j, 0.7923-0.0587j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3689, 0.6311]], grad_fn=<PowBackward0>)
loss:  0.4602328836917877
loss:  0.5920949578285217
loss:  0.6200451850891113
loss:  0.7448650002479553
----------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  rx
rx_matrix theta:  tensor([[-0.0340+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0170j],
        [0.0000+0.0170j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3564-0.3427j, 0.6257+0.6034j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6208+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6892-0.j, -0.7245-0.j],
        [ 0.7245+0.j,  0.6892-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3564-0.3427j, 0.6257+0.6034j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2077-0.6734j,  0.6895+0.1675j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4965, 0.5035]], grad_fn=<PowBackward0>)
loss:  0.6862660646438599
loss:  0.7074829339981079
loss:  0.3543281853199005
loss:  1.2872511148452759
----------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  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4633-0.3220j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6192+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6898-0.j, -0.7240-0.j],
        [ 0.7240+0.j,  0.6898-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4633-0.3220j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1671-0.5691j,  0.7992+0.0975j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3518, 0.6482]], grad_fn=<PowBackward0>)
loss:  0.4336198568344116
loss:  0.845855176448822
loss:  0.6930534839630127
loss:  0.20516082644462585
----------index56----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1375-0.1100j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6174+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6904-0.j, -0.7234-0.j],
        [ 0.7234+0.j,  0.6904-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1375-0.1100j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4529-0.5308j,  0.6224+0.3545j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4869, 0.5131]], grad_fn=<PowBackward0>)
loss:  0.6673223376274109
loss:  0.12920264899730682
loss:  0.46551018953323364
loss:  0.8562961220741272
----------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  rx
rx_matrix theta:  tensor([[-0.0337+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7532-0.3527j, 0.4974+0.2470j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6157+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6911-0.j, -0.7228-0.j],
        [ 0.7228+0.j,  0.6911-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7532-0.3527j, 0.4974+0.2470j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1610-0.4222j, 0.8881-0.0842j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2042, 0.7958]], grad_fn=<PowBackward0>)
loss:  0.2283976823091507
loss:  0.3066719174385071
loss:  0.3799732029438019
loss:  0.4403945207595825
----------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  rx
rx_matrix theta:  tensor([[-0.0335+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3053-0.2096j, 0.7572+0.5381j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6142+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6916-0.j, -0.7223-0.j],
        [ 0.7223+0.j,  0.6916-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3053-0.2096j, 0.7572+0.5381j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3358-0.5336j,  0.7442+0.2207j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3975, 0.6025]], grad_fn=<PowBackward0>)
loss:  0.5065995454788208
loss:  0.298341304063797
loss:  0.6180772185325623
loss:  0.4056861996650696
----------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  rx
rx_matrix theta:  tensor([[-0.0334+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8085-0.2788j, 0.4848+0.1833j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6130+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6920-0.j, -0.7219-0.j],
        [ 0.7219+0.j,  0.6920-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8085-0.2788j, 0.4848+0.1833j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2096-0.3252j, 0.9191-0.0744j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1497, 0.8503]], grad_fn=<PowBackward0>)
loss:  0.16217024624347687
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5125012397766113
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0334+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5264-0.5468j, 0.4521+0.4685j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6127+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6921-0.j, -0.7218-0.j],
        [ 0.7218+0.j,  0.6921-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5264-0.5468j, 0.4521+0.4685j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0380-0.7166j, 0.6929-0.0705j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5150, 0.4850]], grad_fn=<PowBackward0>)
loss:  0.6636072993278503
loss:  0.4627850651741028
loss:  0.22914297878742218
loss:  0.25753268599510193
----------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  rx
rx_matrix theta:  tensor([[-0.0333+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2465-0.2006j, 0.7292+0.6060j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6120+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6924-0.j, -0.7215-0.j],
        [ 0.7215+0.j,  0.6924-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2465-0.2006j, 0.7292+0.6060j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3554-0.5761j,  0.6828+0.2748j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4583, 0.5417]], grad_fn=<PowBackward0>)
loss:  0.6130192875862122
loss:  0.16113793849945068
loss:  0.42322874069213867
loss:  0.473396360874176
----------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  rx
rx_matrix theta:  tensor([[-0.0330+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0165j],
        [0.0000+0.0165j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6358-0.5674j, 0.3889+0.3500j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6113+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6927-0.j, -0.7213-0.j],
        [ 0.7213+0.j,  0.6927-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6358-0.5674j, 0.3889+0.3500j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1599-0.6455j, 0.7280-0.1669j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4422, 0.5578]], grad_fn=<PowBackward0>)
loss:  0.8160090446472168
loss:  0.7433686256408691
loss:  0.5490580201148987
loss:  0.20539869368076324
----------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  rx
rx_matrix theta:  tensor([[-0.0328+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7222-0.5975j, 0.2664+0.2246j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6104+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6930-0.j, -0.7210-0.j],
        [ 0.7210+0.j,  0.6930-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7222-0.5975j, 0.2664+0.2246j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3084-0.5760j, 0.7053-0.2751j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4269, 0.5731]], grad_fn=<PowBackward0>)
loss:  0.8512803912162781
loss:  0.30035829544067383
loss:  0.6879875659942627
loss:  0.8847348690032959
----------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  rx
rx_matrix theta:  tensor([[-0.0328+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3765-0.2603j, 0.7244+0.5154j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6093+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6934-0.j, -0.7206-0.j],
        [ 0.7206+0.j,  0.6934-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3765-0.2603j, 0.7244+0.5154j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2610-0.5519j,  0.7736+0.1698j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3727, 0.6273]], grad_fn=<PowBackward0>)
loss:  0.46632522344589233
loss:  0.49252644181251526
loss:  0.09888090193271637
loss:  0.43712303042411804
----------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  rx
rx_matrix theta:  tensor([[-0.0328+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7766-0.5946j, 0.1625+0.1299j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6080+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6938-0.j, -0.7202-0.j],
        [ 0.7202+0.j,  0.6938-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7766-0.5946j, 0.1625+0.1299j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4218-0.5061j, 0.6720-0.3381j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4341, 0.5659]], grad_fn=<PowBackward0>)
loss:  0.8345690965652466
loss:  0.2796552777290344
loss:  0.476520299911499
loss:  0.6792664527893066
----------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  rx
rx_matrix theta:  tensor([[-0.0329+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0165j],
        [0.0000+0.0165j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8109-0.3322j, 0.4406+0.1948j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6067+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6943-0.j, -0.7197-0.j],
        [ 0.7197+0.j,  0.6943-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8109-0.3322j, 0.4406+0.1948j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2459-0.3709j, 0.8895-0.1038j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1980, 0.8020]], grad_fn=<PowBackward0>)
loss:  0.22067619860172272
loss:  0.3534766733646393
loss:  0.8825472593307495
loss:  0.305634468793869
----------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  rx
rx_matrix theta:  tensor([[-0.0329+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0165j],
        [0.0000+0.0165j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3289-0.5675j, 0.3889+0.6470j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6056+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6947-0.j, -0.7193-0.j],
        [ 0.7193+0.j,  0.6947-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3289-0.5675j, 0.3889+0.6470j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0513-0.8596j,  0.5067+0.0413j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7415, 0.2585]], grad_fn=<PowBackward0>)
loss:  0.2990342676639557
loss:  0.48471397161483765
loss:  0.055278245359659195
loss:  0.46213585138320923
----------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  rx
rx_matrix theta:  tensor([[-0.0329+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9056-0.3165j, 0.2618+0.1056j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6047+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6950-0.j, -0.7190-0.j],
        [ 0.7190+0.j,  0.6950-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9056-0.3165j, 0.2618+0.1056j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4411-0.2959j, 0.8331-0.1542j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2822, 0.7178]], grad_fn=<PowBackward0>)
loss:  1.2652778625488281
loss:  0.25315549969673157
loss:  0.6027638912200928
loss:  0.4372028410434723
----------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  rx
rx_matrix theta:  tensor([[-0.0329+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5813-0.4064j, 0.5733+0.4102j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6037+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6954-0.j, -0.7186-0.j],
        [ 0.7186+0.j,  0.6954-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5813-0.4064j, 0.5733+0.4102j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0078-0.5774j,  0.8164-0.0068j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3334, 0.6666]], grad_fn=<PowBackward0>)
loss:  0.405622273683548
loss:  0.8623982071876526
loss:  0.3601735532283783
loss:  0.1831425279378891
----------index40----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5433-0.4128j, 0.5783+0.4472j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6026+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6958-0.j, -0.7183-0.j],
        [ 0.7183+0.j,  0.6958-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5433-0.4128j, 0.5783+0.4472j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0373-0.6085j,  0.7926+0.0146j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3716, 0.6284]], grad_fn=<PowBackward0>)
loss:  0.4646104872226715
loss:  0.683504045009613
loss:  0.7249360084533691
loss:  0.43653878569602966
----------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  rx
rx_matrix theta:  tensor([[-0.0330+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0165j],
        [0.0000+0.0165j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6502-0.6750j, 0.2425+0.2508j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6014+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6962-0.j, -0.7179-0.j],
        [ 0.7179+0.j,  0.6962-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6502-0.6750j, 0.2425+0.2508j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2786-0.6500j, 0.6355-0.3100j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5000, 0.5000]], grad_fn=<PowBackward0>)
loss:  0.6930580139160156
loss:  0.37615954875946045
loss:  0.7901514768600464
loss:  0.5905358791351318
----------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  rx
rx_matrix theta:  tensor([[-0.0332+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6138-0.5910j, 0.3765+0.3635j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6000+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6967-0.j, -0.7173-0.j],
        [ 0.7173+0.j,  0.6967-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6138-0.5910j, 0.3765+0.3635j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1576-0.6726j, 0.7026-0.1707j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4772, 0.5228]], grad_fn=<PowBackward0>)
loss:  0.7398639917373657
loss:  0.651153028011322
loss:  0.9676022529602051
loss:  0.4277244210243225
----------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  rx
rx_matrix theta:  tensor([[-0.0335+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6949-0.5304j, 0.3830+0.2986j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5984+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6973-0.j, -0.7168-0.j],
        [ 0.7168+0.j,  0.6973-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5304j, 0.3830+0.2986j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2100-0.5838j, 0.7651-0.1720j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3850, 0.6150]], grad_fn=<PowBackward0>)
loss:  0.9546169638633728
loss:  0.6058845520019531
loss:  0.6666766405105591
loss:  0.7375844120979309
----------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  rx
rx_matrix theta:  tensor([[-0.0338+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6835-0.6104j, 0.2972+0.2682j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5968+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6978-0.j, -0.7163-0.j],
        [ 0.7163+0.j,  0.6978-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6835-0.6104j, 0.2972+0.2682j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2641-0.6180j, 0.6970-0.2500j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4517, 0.5483]], grad_fn=<PowBackward0>)
loss:  0.7947533130645752
loss:  0.7944512963294983
loss:  0.3592970073223114
loss:  0.1237533763051033
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8084-0.2786j, 0.4849+0.1836j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5953+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6984-0.j, -0.7157-0.j],
        [ 0.7157+0.j,  0.6984-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8084-0.2786j, 0.4849+0.1836j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2176-0.3260j, 0.9172-0.0712j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1536, 0.8464]], grad_fn=<PowBackward0>)
loss:  0.16676749289035797
loss:  0.6004890203475952
loss:  0.43545621633529663
loss:  0.3044464886188507
----------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  rx
rx_matrix theta:  tensor([[-0.0343+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3143-0.2222j, 0.7536+0.5329j]])
New state:  tensor([[0.3051-0.2093j, 0.7573+0.5382j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5939+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6989-0.j, -0.7152-0.j],
        [ 0.7152+0.j,  0.6989-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3051-0.2093j, 0.7573+0.5382j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3284-0.5312j,  0.7475+0.2265j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3900, 0.6100]], grad_fn=<PowBackward0>)
loss:  0.4943254292011261
loss:  0.6096621751785278
loss:  0.6710720062255859
loss:  0.715499758720398
----------index68----------
train inputs:  tensor([[1.2310, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6976-0.4071j, 0.5040+0.3060j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5925+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6994-0.j, -0.7147-0.j],
        [ 0.7147+0.j,  0.6994-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6976-0.4071j, 0.5040+0.3060j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1276-0.5035j, 0.8511-0.0770j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2698, 0.7302]], grad_fn=<PowBackward0>)
loss:  0.3143978714942932
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5059456825256348
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0344+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6500-0.6748j, 0.2429+0.2513j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5922+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6995-0.j, -0.7146-0.j],
        [ 0.7146+0.j,  0.6995-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6500-0.6748j, 0.2429+0.2513j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2810-0.6516j, 0.6344-0.3065j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5036, 0.4964]], grad_fn=<PowBackward0>)
loss:  0.6860583424568176
loss:  0.7909965515136719
loss:  0.1677674800157547
loss:  0.2554359436035156
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5671-0.3283j, 0.6473+0.3894j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5909+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7000-0.j, -0.7142-0.j],
        [ 0.7142+0.j,  0.7000-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5671-0.3283j, 0.6473+0.3894j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0653-0.5079j,  0.8581+0.0381j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2622, 0.7378]], grad_fn=<PowBackward0>)
loss:  0.304103821516037
loss:  0.3003008961677551
loss:  0.058842141181230545
loss:  0.35860657691955566
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5198-0.1342j, 0.8096+0.2373j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5900+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7003-0.j, -0.7139-0.j],
        [ 0.7139+0.j,  0.7003-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5198-0.1342j, 0.8096+0.2373j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2140-0.2634j,  0.9380+0.0704j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1152, 0.8848]], grad_fn=<PowBackward0>)
loss:  0.12235260754823685
loss:  0.3525750935077667
loss:  0.42760229110717773
loss:  0.7892018556594849
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5261-0.5466j, 0.4524+0.4688j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5892+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7006-0.j, -0.7136-0.j],
        [ 0.7136+0.j,  0.7006-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5261-0.5466j, 0.4524+0.4688j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0458-0.7174j, 0.6924-0.0616j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5168, 0.4832]], grad_fn=<PowBackward0>)
loss:  0.660091757774353
loss:  0.4638148844242096
loss:  0.2756233811378479
loss:  0.6689972877502441
----------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  rx
rx_matrix theta:  tensor([[-0.0346+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6736-0.5566j, 0.3726+0.3126j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5883+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7009-0.j, -0.7133-0.j],
        [ 0.7133+0.j,  0.7009-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6736-0.5566j, 0.3726+0.3126j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2064-0.6130j, 0.7416-0.1779j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4184, 0.5816]], grad_fn=<PowBackward0>)
loss:  0.8713198304176331
loss:  0.0955110639333725
loss:  0.534633219242096
loss:  0.831354022026062
----------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  rx
rx_matrix theta:  tensor([[-0.0346+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2461-0.2002j, 0.7294+0.6061j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5873+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7012-0.j, -0.7129-0.j],
        [ 0.7129+0.j,  0.7012-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2461-0.2002j, 0.7294+0.6061j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3474-0.5725j,  0.6869+0.2824j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4484, 0.5516]], grad_fn=<PowBackward0>)
loss:  0.594929575920105
loss:  0.2350156009197235
loss:  0.6634517312049866
loss:  0.2064276784658432
----------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  rx
rx_matrix theta:  tensor([[-0.0347+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4983-0.3778j, 0.6175+0.4772j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5862+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7017-0.j, -0.7125-0.j],
        [ 0.7125+0.j,  0.7017-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4983-0.3778j, 0.6175+0.4772j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0904-0.6051j,  0.7883+0.0656j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3743, 0.6257]], grad_fn=<PowBackward0>)
loss:  0.4688882529735565
loss:  0.668730616569519
loss:  0.8433570265769958
loss:  0.17773573100566864
----------index28----------
train inputs:  tensor([[0.9818, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6947-0.5302j, 0.3833+0.2990j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5851+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7020-0.j, -0.7121-0.j],
        [ 0.7121+0.j,  0.7020-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6947-0.5302j, 0.3833+0.2990j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2148-0.5851j, 0.7638-0.1676j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3885, 0.6115]], grad_fn=<PowBackward0>)
loss:  0.9455522298812866
loss:  0.31598201394081116
loss:  0.6058559417724609
loss:  0.3034268021583557
----------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  rx
rx_matrix theta:  tensor([[-0.0347+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4882-0.5478j, 0.4540+0.5054j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5839+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7025-0.j, -0.7117-0.j],
        [ 0.7117+0.j,  0.7025-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4882-0.5478j, 0.4540+0.5054j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0198-0.7445j, 0.6664-0.0348j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5547, 0.4453]], grad_fn=<PowBackward0>)
loss:  0.589322030544281
loss:  0.40561529994010925
loss:  0.3578314483165741
loss:  0.8018308281898499
----------index36----------
train inputs:  tensor([[1.9106, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4632-0.3217j, 0.6724+0.4795j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5830+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7028-0.j, -0.7114-0.j],
        [ 0.7114+0.j,  0.7028-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4632-0.3217j, 0.6724+0.4795j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1528-0.5672j,  0.8020+0.1081j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3451, 0.6549]], grad_fn=<PowBackward0>)
loss:  0.42327162623405457
loss:  0.7332143783569336
loss:  0.4779328405857086
loss:  0.46480828523635864
----------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  rx
rx_matrix theta:  tensor([[-0.0347+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3395-0.5738j, 0.3795+0.6415j]])
New state:  tensor([[0.3283-0.5671j, 0.3894+0.6473j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5821+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7031-0.j, -0.7111-0.j],
        [ 0.7111+0.j,  0.7031-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3283-0.5671j, 0.3894+0.6473j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0461-0.8590j,  0.5072+0.0518j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7400, 0.2600]], grad_fn=<PowBackward0>)
loss:  0.30105844140052795
loss:  0.8673145174980164
loss:  1.2319543361663818
loss:  0.7311187386512756
----------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  rx
rx_matrix theta:  tensor([[-0.0347+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5974-0.5752j, 0.4020+0.3881j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5811+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7034-0.j, -0.7108-0.j],
        [ 0.7108+0.j,  0.7034-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5974-0.5752j, 0.4020+0.3881j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1345-0.6805j, 0.7074-0.1358j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4811, 0.5189]], grad_fn=<PowBackward0>)
loss:  0.7315822243690491
loss:  0.4865175485610962
loss:  0.3706558644771576
loss:  0.4528146982192993
----------index48----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6060-0.3160j, 0.6406+0.3500j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5799+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7039-0.j, -0.7103-0.j],
        [ 0.7103+0.j,  0.7039-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6060-0.3160j, 0.6406+0.3500j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0285-0.4711j,  0.8814+0.0219j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2227, 0.7773]], grad_fn=<PowBackward0>)
loss:  0.2519591152667999
loss:  0.46274861693382263
loss:  0.42987021803855896
loss:  0.4297943711280823
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6834-0.2762j, 0.6202+0.2685j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5788+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7043-0.j, -0.7099-0.j],
        [ 0.7099+0.j,  0.7043-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.2762j, 0.6202+0.2685j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0410-0.3851j, 0.9219-0.0069j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1500, 0.8500]], grad_fn=<PowBackward0>)
loss:  0.16250894963741302
loss:  0.6693464517593384
loss:  0.42992445826530457
loss:  0.7004417777061462
----------index56----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0106+0.0138j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5778+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7046-0.j, -0.7096-0.j],
        [ 0.7096+0.j,  0.7046-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7934-0.6085j, 0.0106+0.0138j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5515-0.4386j, 0.5704-0.4220j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4965, 0.5035]], grad_fn=<PowBackward0>)
loss:  0.700129508972168
loss:  0.5877795219421387
loss:  0.2303999960422516
loss:  0.41535431146621704
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5029-0.6598j, 0.3428+0.4407j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5764+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7051-0.j, -0.7091-0.j],
        [ 0.7091+0.j,  0.7051-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5029-0.6598j, 0.3428+0.4407j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1116-0.7777j, 0.5983-0.1571j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6173, 0.3827]], grad_fn=<PowBackward0>)
loss:  0.4823570251464844
loss:  0.8015869855880737
loss:  0.7695803046226501
loss:  0.5947712063789368
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4744-0.6231j, 0.3813+0.4912j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5750+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7056-0.j, -0.7086-0.j],
        [ 0.7086+0.j,  0.7056-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4744-0.6231j, 0.3813+0.4912j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0646-0.7877j, 0.6052-0.0949j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6247, 0.3753]], grad_fn=<PowBackward0>)
loss:  0.4704555869102478
loss:  0.6670547127723694
loss:  0.9529830813407898
loss:  0.597579836845398
----------index68----------
train inputs:  tensor([[2.7543, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.7543]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.7543+0.j]])
ry_matrix:  tensor([[ 0.1925-0.j, -0.9813-0.j],
        [ 0.9813+0.j,  0.1925-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1372-0.1097j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5736+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7061-0.j, -0.7081-0.j],
        [ 0.7081+0.j,  0.7061-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1372-0.1097j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4394-0.5227j,  0.6320+0.3664j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4663, 0.5337]], grad_fn=<PowBackward0>)
loss:  0.6280052661895752
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5000295042991638
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4750-0.1556j, 0.8143+0.2952j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5732+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7063-0.j, -0.7080-0.j],
        [ 0.7080+0.j,  0.7063-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4750-0.1556j, 0.8143+0.2952j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2410-0.3189j,  0.9114+0.0983j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1598, 0.8402]], grad_fn=<PowBackward0>)
loss:  0.17407019436359406
loss:  0.3566465973854065
loss:  0.30228886008262634
loss:  0.35658037662506104
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2461-0.2001j, 0.7294+0.6062j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5720+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7067-0.j, -0.7075-0.j],
        [ 0.7075+0.j,  0.7067-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2461-0.2001j, 0.7294+0.6062j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3422-0.5703j,  0.6895+0.2868j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4423, 0.5577]], grad_fn=<PowBackward0>)
loss:  0.5839104056358337
loss:  0.25159868597984314
loss:  0.4275817275047302
loss:  0.6258854269981384
----------index8----------
train inputs:  tensor([[1.2310, 1.6821]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.2310]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.2310+0.j]])
ry_matrix:  tensor([[ 0.8165-0.j, -0.5774-0.j],
        [ 0.5774+0.j,  0.8165-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5367-0.6018j, 0.3955+0.4398j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5709+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7071-0.j, -0.7071-0.j],
        [ 0.7071+0.j,  0.7071-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5367-0.6018j, 0.3955+0.4398j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0999-0.7365j, 0.6592-0.1146j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5524, 0.4476]], grad_fn=<PowBackward0>)
loss:  0.5935484766960144
loss:  0.31890669465065
loss:  0.6927119493484497
loss:  0.06394856423139572
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6947-0.5301j, 0.3834+0.2990j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5698+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7074-0.j, -0.7068-0.j],
        [ 0.7068+0.j,  0.7074-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6947-0.5301j, 0.3834+0.2990j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2205-0.5864j, 0.7622-0.1631j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3925, 0.6075]], grad_fn=<PowBackward0>)
loss:  0.9352915287017822
loss:  0.42697760462760925
loss:  0.7948548197746277
loss:  1.2138445377349854
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5261-0.5465j, 0.4525+0.4689j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5687+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7079-0.j, -0.7064-0.j],
        [ 0.7064+0.j,  0.7079-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5261-0.5465j, 0.4525+0.4689j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0527-0.7180j, 0.6919-0.0541j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5184, 0.4816]], grad_fn=<PowBackward0>)
loss:  0.6570886969566345
loss:  0.4791603684425354
loss:  0.11702606081962585
loss:  0.27133291959762573
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6834-0.2761j, 0.6202+0.2686j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5674+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7083-0.j, -0.7059-0.j],
        [ 0.7059+0.j,  0.7083-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.2761j, 0.6202+0.2686j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0462-0.3851j, 0.9217-0.0047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1505, 0.8495]], grad_fn=<PowBackward0>)
loss:  0.16307835280895233
loss:  0.30177175998687744
loss:  0.5216866731643677
loss:  0.4466116428375244
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4494-0.3400j, 0.6539+0.5048j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5664+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7087-0.j, -0.7055-0.j],
        [ 0.7055+0.j,  0.7087-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4494-0.3400j, 0.6539+0.5048j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1429-0.5971j,  0.7805+0.1179j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3770, 0.6230]], grad_fn=<PowBackward0>)
loss:  0.4731696844100952
loss:  0.6591510772705078
loss:  0.4667961299419403
loss:  0.658623456954956
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0175j],
        [0.0000+0.0175j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6735-0.5565j, 0.3727+0.3127j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7090-0.j, -0.7052-0.j],
        [ 0.7052+0.j,  0.7090-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6735-0.5565j, 0.3727+0.3127j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2148-0.6151j, 0.7392-0.1707j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4244, 0.5756]], grad_fn=<PowBackward0>)
loss:  0.8569630980491638
loss:  0.4153250455856323
loss:  0.8214602470397949
loss:  0.8114990592002869
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0175j],
        [0.0000+0.0175j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6677-0.3102j, 0.6073+0.2986j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5641+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7095-0.j, -0.7047-0.j],
        [ 0.7047+0.j,  0.7095-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6677-0.3102j, 0.6073+0.2986j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0457-0.4305j, 0.9014-0.0068j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1874, 0.8126]], grad_fn=<PowBackward0>)
loss:  0.20754334330558777
loss:  0.30279526114463806
loss:  0.5940322279930115
loss:  0.24072673916816711
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0175j],
        [0.0000+0.0175j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6774-0.5166j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5630+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7098-0.j, -0.7044-0.j],
        [ 0.7044+0.j,  0.7098-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6774-0.5166j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1899-0.5934j, 0.7704-0.1355j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3881, 0.6119]], grad_fn=<PowBackward0>)
loss:  0.94638991355896
loss:  0.722427248954773
loss:  0.4175899922847748
loss:  0.684685468673706
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8107-0.3318j, 0.4409+0.1956j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5620+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7102-0.j, -0.7040-0.j],
        [ 0.7040+0.j,  0.7102-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8107-0.3318j, 0.4409+0.1956j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2653-0.3734j, 0.8839-0.0947j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2098, 0.7902]], grad_fn=<PowBackward0>)
loss:  0.23547592759132385
loss:  0.46226605772972107
loss:  0.17591308057308197
loss:  0.42467740178108215
----------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  rx
rx_matrix theta:  tensor([[-0.0349+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6834-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5612+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7105-0.j, -0.7037-0.j],
        [ 0.7037+0.j,  0.7105-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2761-0.6225j, 0.6923-0.2386j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4638, 0.5362]], grad_fn=<PowBackward0>)
loss:  0.7683136463165283
loss:  0.7862955331802368
loss:  0.7236377000808716
loss:  0.30039072036743164
----------index48----------
train inputs:  tensor([[1.1512, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5029-0.6598j, 0.3428+0.4407j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5602+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7108-0.j, -0.7033-0.j],
        [ 0.7033+0.j,  0.7108-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5029-0.6598j, 0.3428+0.4407j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1164-0.7790j, 0.5974-0.1507j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6204, 0.3796]], grad_fn=<PowBackward0>)
loss:  0.47743260860443115
loss:  0.09119582921266556
loss:  0.41163238883018494
loss:  0.6555548310279846
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6834-0.6102j, 0.2975+0.2685j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5593+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7112-0.j, -0.7030-0.j],
        [ 0.7030+0.j,  0.7112-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.6102j, 0.2975+0.2685j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2768-0.6227j, 0.6920-0.2380j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4644, 0.5356]], grad_fn=<PowBackward0>)
loss:  0.7669311165809631
loss:  0.25249505043029785
loss:  0.5745093822479248
loss:  0.46408095955848694
----------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  rx
rx_matrix theta:  tensor([[-0.0347+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5752-0.3672j, 0.6105+0.4020j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5583+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7115-0.j, -0.7027-0.j],
        [ 0.7027+0.j,  0.7115-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5752-0.3672j, 0.6105+0.4020j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0197-0.5437j,  0.8386+0.0280j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2960, 0.7040]], grad_fn=<PowBackward0>)
loss:  0.35100942850112915
loss:  0.7257199287414551
loss:  0.5875210165977478
loss:  0.46732547879219055
----------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  rx
rx_matrix theta:  tensor([[-0.0348+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9998+0.0000j, 0.0000+0.0174j],
        [0.0000+0.0174j, 0.9998+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5809-0.4058j, 0.5737+0.4108j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5575+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7118-0.j, -0.7024-0.j],
        [ 0.7024+0.j,  0.7118-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5809-0.4058j, 0.5737+0.4108j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0105-0.5774j, 0.8164+0.0073j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3335, 0.6665]], grad_fn=<PowBackward0>)
loss:  0.4057013988494873
loss:  0.5946858525276184
loss:  0.6600646376609802
loss:  0.8516989350318909
----------index64----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6209-0.6447j, 0.3098+0.3207j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5566+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7121-0.j, -0.7021-0.j],
        [ 0.7021+0.j,  0.7121-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6209-0.6447j, 0.3098+0.3207j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2246-0.6843j, 0.6565-0.2243j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5187, 0.4813]], grad_fn=<PowBackward0>)
loss:  0.6565134525299072
loss:  0.6563599705696106
loss:  0.46282899379730225
loss:  0.3642030358314514
----------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  rx
rx_matrix theta:  tensor([[-0.0346+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6988-0.6241j, 0.2593+0.2344j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5556+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7125-0.j, -0.7017-0.j],
        [ 0.7017+0.j,  0.7125-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6988-0.6241j, 0.2593+0.2344j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3159-0.6091j, 0.6751-0.2710j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4708, 0.5292]], grad_fn=<PowBackward0>)
loss:  0.753243088722229
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49455365538597107
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0346+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6135-0.5908j, 0.3769+0.3640j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5553+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7126-0.j, -0.7016-0.j],
        [ 0.7016+0.j,  0.7126-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6135-0.5908j, 0.3769+0.3640j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1727-0.6763j, 0.6990-0.1551j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4873, 0.5127]], grad_fn=<PowBackward0>)
loss:  0.7189448475837708
loss:  0.5144751667976379
loss:  0.3546938896179199
loss:  0.4057242274284363
----------index4----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4495-0.3401j, 0.6538+0.5047j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5543+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7129-0.j, -0.7013-0.j],
        [ 0.7013+0.j,  0.7129-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4495-0.3401j, 0.6538+0.5047j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1381-0.5964j,  0.7813+0.1213j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3748, 0.6252]], grad_fn=<PowBackward0>)
loss:  0.46968144178390503
loss:  0.06811540573835373
loss:  0.3224503993988037
loss:  0.7871245741844177
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3563-0.3426j, 0.6258+0.6034j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3563-0.3426j, 0.6258+0.6034j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1846-0.6673j,  0.6960+0.1902j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4794, 0.5206]], grad_fn=<PowBackward0>)
loss:  0.6527368426322937
loss:  0.4224194586277008
loss:  0.20815932750701904
loss:  0.1681659072637558
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7220-0.5973j, 0.2669+0.2253j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5530+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7134-0.j, -0.7008-0.j],
        [ 0.7008+0.j,  0.7134-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7220-0.5973j, 0.2669+0.2253j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3280-0.5839j, 0.6964-0.2579j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4486, 0.5514]], grad_fn=<PowBackward0>)
loss:  0.8017213344573975
loss:  0.47519659996032715
loss:  0.46306392550468445
loss:  0.41005009412765503
----------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  rx
rx_matrix theta:  tensor([[-0.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5368-0.6019j, 0.3953+0.4397j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5522+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7137-0.j, -0.7005-0.j],
        [ 0.7005+0.j,  0.7137-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5368-0.6019j, 0.3953+0.4397j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1062-0.7375j, 0.6582-0.1078j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5552, 0.4448]], grad_fn=<PowBackward0>)
loss:  0.5884839296340942
loss:  0.7616093158721924
loss:  0.8485556840896606
loss:  0.654600977897644
----------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  rx
rx_matrix theta:  tensor([[-0.0344+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5818-0.3029j, 0.6626+0.3614j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5513+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7139-0.j, -0.7002-0.j],
        [ 0.7002+0.j,  0.7139-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5818-0.3029j, 0.6626+0.3614j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0486-0.4693j,  0.8805+0.0459j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2226, 0.7774]], grad_fn=<PowBackward0>)
loss:  0.2518497705459595
loss:  1.188764214515686
loss:  0.6082445979118347
loss:  0.2679685354232788
----------index24----------
train inputs:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5753-0.3673j, 0.6104+0.4019j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5503+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7143-0.j, -0.6998-0.j],
        [ 0.6998+0.j,  0.7143-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5753-0.3673j, 0.6104+0.4019j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0163-0.5436j,  0.8386+0.0300j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2958, 0.7042]], grad_fn=<PowBackward0>)
loss:  0.350663959980011
loss:  0.7488180994987488
loss:  0.4687945246696472
loss:  0.4389186203479767
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5818-0.1526j, 0.7663+0.2259j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5493+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7147-0.j, -0.6995-0.j],
        [ 0.6995+0.j,  0.7147-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5818-0.1526j, 0.7663+0.2259j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1202-0.2671j,  0.9546+0.0548j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0858, 0.9142]], grad_fn=<PowBackward0>)
loss:  0.08966372162103653
loss:  0.4211744964122772
loss:  0.24001754820346832
loss:  0.25071606040000916
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6775-0.5168j, 0.4129+0.3215j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5485+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7149-0.j, -0.6992-0.j],
        [ 0.6992+0.j,  0.7149-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6775-0.5168j, 0.4129+0.3215j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1957-0.5943j, 0.7689-0.1315j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3915, 0.6085]], grad_fn=<PowBackward0>)
loss:  0.9378804564476013
loss:  0.30434492230415344
loss:  0.362247496843338
loss:  0.46155184507369995
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4361-0.3025j, 0.6902+0.4918j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5478+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7152-0.j, -0.6989-0.j],
        [ 0.6989+0.j,  0.7152-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4361-0.3025j, 0.6902+0.4918j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1705-0.5601j,  0.7984+0.1403j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3428, 0.6572]], grad_fn=<PowBackward0>)
loss:  0.4197981357574463
loss:  0.46554940938949585
loss:  0.7185338139533997
loss:  0.4628967046737671
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6136-0.3564j, 0.6034+0.3638j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5472+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7154-0.j, -0.6987-0.j],
        [ 0.6987+0.j,  0.7154-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6136-0.3564j, 0.6034+0.3638j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0174-0.5092j, 0.8604+0.0113j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2596, 0.7404]], grad_fn=<PowBackward0>)
loss:  0.3005310297012329
loss:  0.29995521903038025
loss:  0.4667573571205139
loss:  0.5660721659660339
----------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  rx
rx_matrix theta:  tensor([[-0.0343+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4883-0.5479j, 0.4539+0.5053j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5466+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7156-0.j, -0.6985-0.j],
        [ 0.6985+0.j,  0.7156-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4883-0.5479j, 0.4539+0.5053j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0324-0.7450j, 0.6659-0.0211j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5561, 0.4439]], grad_fn=<PowBackward0>)
loss:  0.5867574214935303
loss:  0.16426874697208405
loss:  0.6689993739128113
loss:  0.8450602889060974
----------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  rx
rx_matrix theta:  tensor([[-0.0343+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4124-0.4287j, 0.5580+0.5785j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5459+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7158-0.j, -0.6983-0.j],
        [ 0.6983+0.j,  0.7158-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4124-0.4287j, 0.5580+0.5785j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0944-0.7109j,  0.6874+0.1148j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5142, 0.4858]], grad_fn=<PowBackward0>)
loss:  0.7220560908317566
loss:  0.6517956256866455
loss:  0.5651358366012573
loss:  0.5878421664237976
----------index52----------
train inputs:  tensor([[1.3845, 1.9904]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4098-0.6397j, 0.3585+0.5426j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5450+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7162-0.j, -0.6979-0.j],
        [ 0.6979+0.j,  0.7162-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4098-0.6397j, 0.3585+0.5426j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0433-0.8368j, 0.5427-0.0579j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7021, 0.2979]], grad_fn=<PowBackward0>)
loss:  0.35367292165756226
loss:  0.6674478054046631
loss:  0.4052608013153076
loss:  0.2455030381679535
----------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  rx
rx_matrix theta:  tensor([[-0.0343+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6209-0.6448j, 0.3097+0.3206j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5440+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7165-0.j, -0.6976-0.j],
        [ 0.6976+0.j,  0.7165-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6209-0.6448j, 0.3097+0.3206j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2289-0.6856j, 0.6551-0.2201j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5225, 0.4775]], grad_fn=<PowBackward0>)
loss:  0.6491966247558594
loss:  0.7997668385505676
loss:  0.6493282914161682
loss:  0.7685721516609192
----------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  rx
rx_matrix theta:  tensor([[-0.0342+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0171j],
        [0.0000+0.0171j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8084-0.2786j, 0.4849+0.1836j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5428+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7169-0.j, -0.6972-0.j],
        [ 0.6972+0.j,  0.7169-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8084-0.2786j, 0.4849+0.1836j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2415-0.3277j, 0.9112-0.0626j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1658, 0.8342]], grad_fn=<PowBackward0>)
loss:  0.18122604489326477
loss:  0.6506623029708862
loss:  0.9168457388877869
loss:  0.6480761170387268
----------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  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0170j],
        [0.0000+0.0170j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4633-0.3220j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5417+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7173-0.j, -0.6968-0.j],
        [ 0.6968+0.j,  0.7173-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4633-0.3220j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1360-0.5649j,  0.8050+0.1195j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3377, 0.6623]], grad_fn=<PowBackward0>)
loss:  0.4119683504104614
loss:  0.588258683681488
loss:  0.29945242404937744
loss:  0.7535662055015564
----------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  rx
rx_matrix theta:  tensor([[-0.0337+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5199-0.1345j, 0.8096+0.2371j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5407+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7177-0.j, -0.6964-0.j],
        [ 0.6964+0.j,  0.7177-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5199-0.1345j, 0.8096+0.2371j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1907-0.2617j,  0.9430+0.0765j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1048, 0.8952]], grad_fn=<PowBackward0>)
loss:  0.11073840409517288
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49008509516716003
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0336+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5910-0.6137j, 0.3637+0.3766j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5404+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7178-0.j, -0.6963-0.j],
        [ 0.6963+0.j,  0.7178-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5910-0.6137j, 0.3637+0.3766j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1709-0.7028j, 0.6725-0.1570j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5231, 0.4769]], grad_fn=<PowBackward0>)
loss:  0.6480129957199097
loss:  0.4629735052585602
loss:  0.6461043953895569
loss:  0.40301617980003357
----------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  rx
rx_matrix theta:  tensor([[-0.0335+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5820-0.3032j, 0.6625+0.3612j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5396+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7181-0.j, -0.6960-0.j],
        [ 0.6960+0.j,  0.7181-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5820-0.3032j, 0.6625+0.3612j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0432-0.4691j,  0.8808+0.0483j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2219, 0.7781]], grad_fn=<PowBackward0>)
loss:  0.25091552734375
loss:  0.5862537026405334
loss:  0.3006529211997986
loss:  0.3599645793437958
----------index8----------
train inputs:  tensor([[1.0685, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6137-0.5910j, 0.3766+0.3637j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5389+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7183-0.j, -0.6957-0.j],
        [ 0.6957+0.j,  0.7183-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6137-0.5910j, 0.3766+0.3637j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1788-0.6775j, 0.6975-0.1500j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4910, 0.5090]], grad_fn=<PowBackward0>)
loss:  0.7113467454910278
loss:  0.40717437863349915
loss:  0.661453366279602
loss:  0.3258644640445709
----------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  rx
rx_matrix theta:  tensor([[-0.0336+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5032-0.6600j, 0.3424+0.4404j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5382+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7185-0.j, -0.6955-0.j],
        [ 0.6955+0.j,  0.7185-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5032-0.6600j, 0.3424+0.4404j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1234-0.7805j, 0.5960-0.1425j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6245, 0.3755]], grad_fn=<PowBackward0>)
loss:  0.47084933519363403
loss:  0.5846700072288513
loss:  0.4615679979324341
loss:  0.4336715340614319
----------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  rx
rx_matrix theta:  tensor([[-0.0336+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5754-0.3675j, 0.6103+0.4017j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5375+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7188-0.j, -0.6952-0.j],
        [ 0.6952+0.j,  0.7188-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5754-0.3675j, 0.6103+0.4017j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0107-0.5434j,  0.8387+0.0332j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2954, 0.7046]], grad_fn=<PowBackward0>)
loss:  0.35015803575515747
loss:  0.1828210949897766
loss:  0.5965690612792969
loss:  0.20917603373527527
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5673-0.3286j, 0.6471+0.3891j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5369+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7190-0.j, -0.6950-0.j],
        [ 0.6950+0.j,  0.7190-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5673-0.3286j, 0.6471+0.3891j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0419-0.5067j,  0.8596+0.0514j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2585, 0.7415]], grad_fn=<PowBackward0>)
loss:  0.29909101128578186
loss:  0.24426403641700745
loss:  0.9130691289901733
loss:  0.6594768762588501
----------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  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5976-0.5754j, 0.4018+0.3879j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5364+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7192-0.j, -0.6948-0.j],
        [ 0.6948+0.j,  0.7192-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5976-0.5754j, 0.4018+0.3879j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1506-0.6833j, 0.7042-0.1208j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4896, 0.5104]], grad_fn=<PowBackward0>)
loss:  0.7142162322998047
loss:  0.750126302242279
loss:  0.16330136358737946
loss:  0.5583927631378174
----------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  rx
rx_matrix theta:  tensor([[-0.0339+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6500-0.6749j, 0.2428+0.2511j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5356+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7194-0.j, -0.6946-0.j],
        [ 0.6946+0.j,  0.7194-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6500-0.6749j, 0.2428+0.2511j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2991-0.6599j, 0.6261-0.2881j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5249, 0.4751]], grad_fn=<PowBackward0>)
loss:  0.6444730758666992
loss:  0.7779645323753357
loss:  0.7188199162483215
loss:  0.1650119423866272
----------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  rx
rx_matrix theta:  tensor([[-0.0338+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0169j],
        [0.0000+0.0169j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6776-0.5169j, 0.4128+0.3214j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5347+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7197-0.j, -0.6942-0.j],
        [ 0.6942+0.j,  0.7197-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6776-0.5169j, 0.4128+0.3214j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2011-0.5951j, 0.7675-0.1275j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3946, 0.6054]], grad_fn=<PowBackward0>)
loss:  0.9298223257064819
loss:  0.47076085209846497
loss:  0.41702988743782043
loss:  0.8376362919807434
----------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  rx
rx_matrix theta:  tensor([[-0.0337+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4985-0.3781j, 0.6173+0.4770j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5339+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7200-0.j, -0.6940-0.j],
        [ 0.6940+0.j,  0.7200-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4985-0.3781j, 0.6173+0.4770j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0694-0.6032j,  0.7904+0.0810j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3687, 0.6313]], grad_fn=<PowBackward0>)
loss:  0.4599747955799103
loss:  0.7358307838439941
loss:  0.3525044620037079
loss:  0.25024792551994324
----------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  rx
rx_matrix theta:  tensor([[-0.0336+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0168j],
        [0.0000+0.0168j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7221-0.5974j, 0.2667+0.2249j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5332+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7203-0.j, -0.6937-0.j],
        [ 0.6937+0.j,  0.7203-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7221-0.5974j, 0.2667+0.2249j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3351-0.5863j, 0.6930-0.2524j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4561, 0.5439]], grad_fn=<PowBackward0>)
loss:  0.7851105332374573
loss:  0.6428709030151367
loss:  0.2645685076713562
loss:  0.35239946842193604
----------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  rx
rx_matrix theta:  tensor([[-0.0333+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5524-0.6191j, 0.3732+0.4150j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5324+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7206-0.j, -0.6934-0.j],
        [ 0.6934+0.j,  0.7206-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5524-0.6191j, 0.3732+0.4150j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1393-0.7339j, 0.6520-0.1303j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5579, 0.4421]], grad_fn=<PowBackward0>)
loss:  0.583506166934967
loss:  0.3060210049152374
loss:  0.41470277309417725
loss:  0.6475512981414795
----------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  rx
rx_matrix theta:  tensor([[-0.0329+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0164j],
        [0.0000+0.0164j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9056-0.3165j, 0.2618+0.1056j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5317+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7208-0.j, -0.6931-0.j],
        [ 0.6931+0.j,  0.7208-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9056-0.3165j, 0.2618+0.1056j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4713-0.3013j, 0.8164-0.1432j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3129, 0.6871]], grad_fn=<PowBackward0>)
loss:  1.1619000434875488
loss:  0.5554226040840149
loss:  0.7465288639068604
loss:  0.24893100559711456
----------index52----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5266-0.5470j, 0.4519+0.4682j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5308+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7211-0.j, -0.6928-0.j],
        [ 0.6928+0.j,  0.7211-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5266-0.5470j, 0.4519+0.4682j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0667-0.7189j, 0.6907-0.0414j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5212, 0.4788]], grad_fn=<PowBackward0>)
loss:  0.6515306234359741
loss:  0.499866247177124
loss:  0.07456622272729874
loss:  0.08706922829151154
----------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  rx
rx_matrix theta:  tensor([[-0.0322+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0161j],
        [0.0000+0.0161j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7993-0.5640j, 0.1662+0.1240j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5300+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7214-0.j, -0.6925-0.j],
        [ 0.6925+0.j,  0.7214-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7993-0.5640j, 0.1662+0.1240j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4615-0.4927j, 0.6735-0.3011j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4557, 0.5443]], grad_fn=<PowBackward0>)
loss:  0.7858664989471436
loss:  0.46277275681495667
loss:  0.2985292971134186
loss:  0.40605872869491577
----------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  rx
rx_matrix theta:  tensor([[-0.0322+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0161j],
        [0.0000+0.0161j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4751-0.6236j, 0.3804+0.4906j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5293+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7216-0.j, -0.6923-0.j],
        [ 0.6923+0.j,  0.7216-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4751-0.6236j, 0.3804+0.4906j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0794-0.7896j, 0.6034-0.0777j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6298, 0.3702]], grad_fn=<PowBackward0>)
loss:  0.4622843265533447
loss:  0.10821078717708588
loss:  0.4086321294307709
loss:  0.7544927000999451
----------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  rx
rx_matrix theta:  tensor([[-0.0322+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0161j],
        [0.0000+0.0161j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4771-0.6798j, 0.3253+0.4522j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5286+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7219-0.j, -0.6920-0.j],
        [ 0.6920+0.j,  0.7219-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4771-0.6798j, 0.3253+0.4522j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1193-0.8036j, 0.5650-0.1440j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6601, 0.3399]], grad_fn=<PowBackward0>)
loss:  0.4154105484485626
loss:  0.6402422785758972
loss:  0.4606555700302124
loss:  0.8338398337364197
----------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  rx
rx_matrix theta:  tensor([[-0.0321+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0160j],
        [0.0000+0.0160j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5676-0.6360j, 0.3497+0.3887j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5279+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7221-0.j, -0.6918-0.j],
        [ 0.6918+0.j,  0.7221-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5676-0.6360j, 0.3497+0.3887j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1680-0.7281j, 0.6452-0.1593j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5584, 0.4416]], grad_fn=<PowBackward0>)
loss:  0.5827317833900452
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.48630866408348083
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0320+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0160j],
        [0.0000+0.0160j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3767-0.2606j, 0.7243+0.5153j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5277+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7222-0.j, -0.6917-0.j],
        [ 0.6917+0.j,  0.7222-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3767-0.2606j, 0.7243+0.5153j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2290-0.5446j,  0.7837+0.1919j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3490, 0.6510]], grad_fn=<PowBackward0>)
loss:  0.4293098747730255
loss:  0.2501256763935089
loss:  0.5825228691101074
loss:  0.4131971299648285
----------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  rx
rx_matrix theta:  tensor([[-0.0319+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0160j],
        [0.0000+0.0160j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3531-0.2221j, 0.7609+0.4971j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5271+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7224-0.j, -0.6915-0.j],
        [ 0.6915+0.j,  0.7224-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3531-0.2221j, 0.7609+0.4971j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2710-0.5042j,  0.7938+0.2055j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3276, 0.6724]], grad_fn=<PowBackward0>)
loss:  0.39696863293647766
loss:  0.5878881216049194
loss:  0.46318137645721436
loss:  0.642011284828186
----------index8----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2469-0.2011j, 0.7291+0.6058j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5264+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7226-0.j, -0.6912-0.j],
        [ 0.6912+0.j,  0.7226-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2469-0.2011j, 0.7291+0.6058j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3255-0.5641j,  0.6976+0.2987j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4242, 0.5758]], grad_fn=<PowBackward0>)
loss:  0.5519521236419678
loss:  0.581464409828186
loss:  0.2632918655872345
loss:  0.08651106059551239
----------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  rx
rx_matrix theta:  tensor([[-0.0320+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0160j],
        [0.0000+0.0160j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6837-0.6106j, 0.2967+0.2676j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5258+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7229-0.j, -0.6910-0.j],
        [ 0.6910+0.j,  0.7229-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6837-0.6106j, 0.2967+0.2676j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2892-0.6263j, 0.6869-0.2286j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4759, 0.5241]], grad_fn=<PowBackward0>)
loss:  0.742557168006897
loss:  0.7293272614479065
loss:  0.07595580071210861
loss:  0.2981884777545929
----------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  rx
rx_matrix theta:  tensor([[-0.0318+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0159j],
        [0.0000+0.0159j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4638-0.3227j, 0.6719+0.4788j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5251+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7231-0.j, -0.6908-0.j],
        [ 0.6908+0.j,  0.7231-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4638-0.3227j, 0.6719+0.4788j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1287-0.5641j,  0.8062+0.1233j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3348, 0.6652]], grad_fn=<PowBackward0>)
loss:  0.4076291024684906
loss:  0.21003574132919312
loss:  0.414347380399704
loss:  1.1523555517196655
----------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  rx
rx_matrix theta:  tensor([[-0.0318+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0159j],
        [0.0000+0.0159j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5599-0.5815j, 0.4099+0.4247j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5245+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7233-0.j, -0.6906-0.j],
        [ 0.6906+0.j,  0.7233-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5599-0.5815j, 0.4099+0.4247j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1219-0.7139j, 0.6831-0.0944j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5245, 0.4755]], grad_fn=<PowBackward0>)
loss:  0.6454049348831177
loss:  0.7777363061904907
loss:  0.47218504548072815
loss:  0.7498186230659485
----------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  rx
rx_matrix theta:  tensor([[-0.0316+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0158j],
        [0.0000+0.0158j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6779-0.5173j, 0.4123+0.3206j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5238+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7235-0.j, -0.6903-0.j],
        [ 0.6903+0.j,  0.7235-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6779-0.5173j, 0.4123+0.3206j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2059-0.5956j, 0.7663-0.1251j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3972, 0.6028]], grad_fn=<PowBackward0>)
loss:  0.9233766198158264
loss:  0.2489900290966034
loss:  0.4534848928451538
loss:  0.49561500549316406
----------index28----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5980-0.5759j, 0.4011+0.3871j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5232+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7237-0.j, -0.6901-0.j],
        [ 0.6901+0.j,  0.7237-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5980-0.5759j, 0.4011+0.3871j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1561-0.6839j, 0.7030-0.1172j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4921, 0.5079]], grad_fn=<PowBackward0>)
loss:  0.7090302109718323
loss:  0.6353773474693298
loss:  0.46113139390945435
loss:  0.903597354888916
----------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  rx
rx_matrix theta:  tensor([[-0.0312+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4503-0.3412j, 0.6533+0.5040j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5224+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7240-0.j, -0.6898-0.j],
        [ 0.6898+0.j,  0.7240-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4503-0.3412j, 0.6533+0.5040j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1246-0.5947j,  0.7836+0.1295j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3692, 0.6308]], grad_fn=<PowBackward0>)
loss:  0.46074336767196655
loss:  0.24967852234840393
loss:  0.7035078406333923
loss:  0.29795101284980774
----------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  rx
rx_matrix theta:  tensor([[-0.0309+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0155j],
        [0.0000+0.0155j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3574-0.3437j, 0.6251+0.6028j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5217+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7242-0.j, -0.6896-0.j],
        [ 0.6896+0.j,  0.7242-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3574-0.3437j, 0.6251+0.6028j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1723-0.6646j,  0.6992+0.1996j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4713, 0.5287]], grad_fn=<PowBackward0>)
loss:  0.6373822689056396
loss:  0.3071151375770569
loss:  0.6450097560882568
loss:  0.45801448822021484
----------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  rx
rx_matrix theta:  tensor([[-0.0309+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0154j],
        [0.0000+0.0154j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6981-0.4080j, 0.5033+0.3048j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5211+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7245-0.j, -0.6893-0.j],
        [ 0.6893+0.j,  0.7245-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6981-0.4080j, 0.5033+0.3048j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1588-0.5057j, 0.8458-0.0605j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2809, 0.7191]], grad_fn=<PowBackward0>)
loss:  0.3298214077949524
loss:  0.3496493995189667
loss:  0.15916381776332855
loss:  0.3010691702365875
----------index44----------
train inputs:  tensor([[1.8331, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4897-0.3413j, 0.6533+0.4658j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5206+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7246-0.j, -0.6891-0.j],
        [ 0.6891+0.j,  0.7246-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4897-0.3413j, 0.6533+0.4658j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0953-0.5683j,  0.8109+0.1023j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3320, 0.6680]], grad_fn=<PowBackward0>)
loss:  0.4035091698169708
loss:  0.635678231716156
loss:  0.46553555130958557
loss:  0.714493453502655
----------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  rx
rx_matrix theta:  tensor([[-0.0312+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6741-0.5572j, 0.3716+0.3114j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5202+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7248-0.j, -0.6890-0.j],
        [ 0.6890+0.j,  0.7248-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6741-0.5572j, 0.3716+0.3114j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2325-0.6184j, 0.7338-0.1582j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4365, 0.5635]], grad_fn=<PowBackward0>)
loss:  0.8289217948913574
loss:  0.7757958173751831
loss:  0.40625181794166565
loss:  0.35107582807540894
----------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  rx
rx_matrix theta:  tensor([[-0.0312+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4773-0.6799j, 0.3249+0.4520j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5196+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7250-0.j, -0.6888-0.j],
        [ 0.6888+0.j,  0.7250-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4773-0.6799j, 0.3249+0.4520j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1223-0.8042j, 0.5643-0.1407j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6617, 0.3383]], grad_fn=<PowBackward0>)
loss:  0.41287118196487427
loss:  0.18816466629505157
loss:  0.5471066236495972
loss:  0.7698403000831604
----------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  rx
rx_matrix theta:  tensor([[-0.0312+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6214-0.6453j, 0.3087+0.3196j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5190+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7252-0.j, -0.6886-0.j],
        [ 0.6886+0.j,  0.7252-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6214-0.6453j, 0.3087+0.3196j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2381-0.6880j, 0.6518-0.2125j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5300, 0.4700]], grad_fn=<PowBackward0>)
loss:  0.6348394155502319
loss:  0.5847934484481812
loss:  0.6497139930725098
loss:  0.6423332095146179
----------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  rx
rx_matrix theta:  tensor([[-0.0309+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0154j],
        [0.0000+0.0154j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6839-0.2774j, 0.6197+0.2672j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5185+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7254-0.j, -0.6884-0.j],
        [ 0.6884+0.j,  0.7254-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6839-0.2774j, 0.6197+0.2672j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0695-0.3851j, 0.9202+0.0029j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1531, 0.8469]], grad_fn=<PowBackward0>)
loss:  0.16622045636177063
loss:  0.5787252187728882
loss:  0.4602687656879425
loss:  0.10585471987724304
----------index64----------
train inputs:  tensor([[1.1512, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7535-0.3534j, 0.4968+0.2458j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5179+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7256-0.j, -0.6882-0.j],
        [ 0.6882+0.j,  0.7256-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7535-0.3534j, 0.4968+0.2458j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2048-0.4256j, 0.8790-0.0649j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2231, 0.7769]], grad_fn=<PowBackward0>)
loss:  0.25242340564727783
loss:  0.8274608850479126
loss:  0.3508601784706116
loss:  0.35476499795913696
----------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  rx
rx_matrix theta:  tensor([[-0.0304+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6839-0.6109j, 0.2962+0.2670j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5175+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7257-0.j, -0.6880-0.j],
        [ 0.6880+0.j,  0.7257-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6839-0.6109j, 0.2962+0.2670j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2925-0.6270j, 0.6855-0.2265j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4788, 0.5212]], grad_fn=<PowBackward0>)
loss:  0.736572802066803
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4832775592803955
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0304+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6982-0.4081j, 0.5032+0.3046j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5174+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7257-0.j, -0.6880-0.j],
        [ 0.6880+0.j,  0.7257-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6982-0.4081j, 0.5032+0.3046j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1605-0.5058j, 0.8455-0.0597j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2816, 0.7184]], grad_fn=<PowBackward0>)
loss:  0.3307008147239685
loss:  0.6352705359458923
loss:  0.6312173008918762
loss:  0.2514050006866455
----------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  rx
rx_matrix theta:  tensor([[-0.0303+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5649-0.4298j, 0.5572+0.4309j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5170+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7259-0.j, -0.6878-0.j],
        [ 0.6878+0.j,  0.7259-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5649-0.4298j, 0.5572+0.4309j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0268-0.6084j, 0.7930+0.0171j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3709, 0.6291]], grad_fn=<PowBackward0>)
loss:  0.4633939564228058
loss:  0.5454992055892944
loss:  1.1416245698928833
loss:  0.35075682401657104
----------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  rx
rx_matrix theta:  tensor([[-0.0304+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4993-0.3791j, 0.6167+0.4761j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5166+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7260-0.j, -0.6877-0.j],
        [ 0.6877+0.j,  0.7260-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4993-0.3791j, 0.6167+0.4761j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0616-0.6027j,  0.7911+0.0850j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3670, 0.6330]], grad_fn=<PowBackward0>)
loss:  0.4572909474372864
loss:  0.40544235706329346
loss:  0.6401914954185486
loss:  0.3919011950492859
----------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  rx
rx_matrix theta:  tensor([[-0.0305+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6742-0.5573j, 0.3714+0.3112j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5161+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7262-0.j, -0.6875-0.j],
        [ 0.6875+0.j,  0.7262-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6742-0.5573j, 0.3714+0.3112j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2343-0.6187j, 0.7333-0.1572j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4376, 0.5624]], grad_fn=<PowBackward0>)
loss:  0.8263929486274719
loss:  0.7717365622520447
loss:  0.642831563949585
loss:  0.4641212522983551
----------index16----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5439-0.4136j, 0.5777+0.4465j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5155+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7264-0.j, -0.6873-0.j],
        [ 0.6873+0.j,  0.7264-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5439-0.4136j, 0.5777+0.4465j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0020-0.6073j,  0.7935+0.0401j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3688, 0.6312]], grad_fn=<PowBackward0>)
loss:  0.4601704478263855
loss:  0.5444433093070984
loss:  0.08517522364854813
loss:  0.3012239634990692
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5679-0.3297j, 0.6466+0.3882j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5150+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7266-0.j, -0.6871-0.j],
        [ 0.6871+0.j,  0.7266-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5679-0.3297j, 0.6466+0.3882j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0316-0.5062j,  0.8600+0.0555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2573, 0.7427]], grad_fn=<PowBackward0>)
loss:  0.29744359850883484
loss:  0.4486900269985199
loss:  0.2974241077899933
loss:  0.3078724443912506
----------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  rx
rx_matrix theta:  tensor([[-0.0306+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0153j],
        [0.0000+0.0153j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4108-0.6404j, 0.3573+0.5418j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5145+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7267-0.j, -0.6869-0.j],
        [ 0.6869+0.j,  0.7267-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4108-0.6404j, 0.3573+0.5418j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0531-0.8375j, 0.5418-0.0462j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7043, 0.2957]], grad_fn=<PowBackward0>)
loss:  0.3505551218986511
loss:  0.734404444694519
loss:  0.7204525470733643
loss:  0.8252414464950562
----------index28----------
train inputs:  tensor([[1.4595, 0.8897]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6684-0.3115j, 0.6066+0.2971j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5141+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7269-0.j, -0.6868-0.j],
        [ 0.6868+0.j,  0.7269-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6684-0.3115j, 0.6066+0.2971j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0692-0.4305j, 0.8999+0.0020j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1901, 0.8099]], grad_fn=<PowBackward0>)
loss:  0.21086637675762177
loss:  0.3538948595523834
loss:  0.24985957145690918
loss:  0.5770134329795837
----------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  rx
rx_matrix theta:  tensor([[-0.0304+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0152j],
        [0.0000+0.0152j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4899-0.3415j, 0.6532+0.4656j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5137+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7270-0.j, -0.6866-0.j],
        [ 0.6866+0.j,  0.7270-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4899-0.3415j, 0.6532+0.4656j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0923-0.5680j,  0.8112+0.1041j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3311, 0.6689]], grad_fn=<PowBackward0>)
loss:  0.40212807059288025
loss:  0.1572035551071167
loss:  0.7336975932121277
loss:  0.6994722485542297
----------index36----------
train inputs:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5271-0.5475j, 0.4513+0.4677j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5132+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7272-0.j, -0.6865-0.j],
        [ 0.6865+0.j,  0.7272-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5271-0.5475j, 0.4513+0.4677j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0735-0.7192j, 0.6900-0.0358j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5226, 0.4774]], grad_fn=<PowBackward0>)
loss:  0.6488726735115051
loss:  0.41107165813446045
loss:  0.631377100944519
loss:  0.7390168309211731
----------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  rx
rx_matrix theta:  tensor([[-0.0301+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0150j],
        [0.0000+0.0150j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6954-0.5310j, 0.3821+0.2974j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5128+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7273-0.j, -0.6863-0.j],
        [ 0.6863+0.j,  0.7273-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6954-0.5310j, 0.3821+0.2974j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2436-0.5903j, 0.7551-0.1481j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4078, 0.5922]], grad_fn=<PowBackward0>)
loss:  0.8969690203666687
loss:  0.9167030453681946
loss:  0.40645164251327515
loss:  0.24903857707977295
----------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  rx
rx_matrix theta:  tensor([[-0.0297+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0148j],
        [0.0000+0.0148j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3773-0.2615j, 0.7240+0.5148j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5122+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7275-0.j, -0.6861-0.j],
        [ 0.6861+0.j,  0.7275-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3773-0.2615j, 0.7240+0.5148j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2223-0.5434j,  0.7856+0.1952j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3447, 0.6553]], grad_fn=<PowBackward0>)
loss:  0.42268264293670654
loss:  0.45921966433525085
loss:  0.4739345610141754
loss:  0.7672858238220215
----------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  rx
rx_matrix theta:  tensor([[-0.0295+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0147j],
        [0.0000+0.0147j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8606+0.0075j, 0.5091+0.0127j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5117+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7277-0.j, -0.6859-0.j],
        [ 0.6859+0.j,  0.7277-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8606+0.0075j, 0.5091+0.0127j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2770-0.0032j, 0.9608+0.0144j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0767, 0.9233]], grad_fn=<PowBackward0>)
loss:  0.07985036075115204
loss:  0.4106254279613495
loss:  0.26056036353111267
loss:  0.45779353380203247
----------index52----------
train inputs:  tensor([[1.0685, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6365-0.5682j, 0.3879+0.3488j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5113+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7278-0.j, -0.6858-0.j],
        [ 0.6858+0.j,  0.7278-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6365-0.5682j, 0.3879+0.3488j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1972-0.6527j, 0.7188-0.1358j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4649, 0.5351]], grad_fn=<PowBackward0>)
loss:  0.765847384929657
loss:  0.2542645037174225
loss:  0.16681812703609467
loss:  0.34941741824150085
----------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  rx
rx_matrix theta:  tensor([[-0.0291+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0146j],
        [0.0000+0.0146j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5533-0.6199j, 0.3719+0.4138j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5110+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7279-0.j, -0.6857-0.j],
        [ 0.6857+0.j,  0.7279-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5533-0.6199j, 0.3719+0.4138j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1477-0.7350j, 0.6501-0.1238j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5620, 0.4380]], grad_fn=<PowBackward0>)
loss:  0.5762096643447876
loss:  0.7041923999786377
loss:  0.5841478109359741
loss:  0.711806058883667
----------index60----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6218-0.6456j, 0.3080+0.3189j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5107+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7280-0.j, -0.6855-0.j],
        [ 0.6855+0.j,  0.7280-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6218-0.6456j, 0.3080+0.3189j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2416-0.6886j, 0.6505-0.2104j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5326, 0.4674]], grad_fn=<PowBackward0>)
loss:  0.6300102472305298
loss:  0.5771604776382446
loss:  0.5742897987365723
loss:  0.6345819234848022
----------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  rx
rx_matrix theta:  tensor([[-0.0287+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4375-0.3044j, 0.6894+0.4906j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5103+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7282-0.j, -0.6854-0.j],
        [ 0.6854+0.j,  0.7282-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4375-0.3044j, 0.6894+0.4906j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1539-0.5580j,  0.8018+0.1486j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3350, 0.6650]], grad_fn=<PowBackward0>)
loss:  0.4079868495464325
loss:  0.48802411556243896
loss:  0.19106334447860718
loss:  0.634730875492096
----------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5205-0.1366j, 0.8092+0.2358j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5098+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7283-0.j, -0.6852-0.j],
        [ 0.6852+0.j,  0.7283-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5205-0.1366j, 0.8092+0.2358j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1754-0.2610j,  0.9460+0.0781j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0989, 0.9011]], grad_fn=<PowBackward0>)
loss:  0.10416155308485031
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4810437262058258
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5822-0.4076j, 0.5724+0.4090j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5097+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7284-0.j, -0.6852-0.j],
        [ 0.6852+0.j,  0.7284-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5822-0.4076j, 0.5724+0.4090j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0318-0.5771j, 0.8158+0.0186j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3341, 0.6659]], grad_fn=<PowBackward0>)
loss:  0.40656575560569763
loss:  0.3500118553638458
loss:  0.8222702145576477
loss:  0.21127617359161377
----------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  rx
rx_matrix theta:  tensor([[-0.0285+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6745-0.5577j, 0.3709+0.3105j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5094+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7285-0.j, -0.6851-0.j],
        [ 0.6851+0.j,  0.7285-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6745-0.5577j, 0.3709+0.3105j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2373-0.6190j, 0.7323-0.1558j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4395, 0.5605]], grad_fn=<PowBackward0>)
loss:  0.8221818804740906
loss:  0.30144158005714417
loss:  0.10405439883470535
loss:  0.47436273097991943
----------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  rx
rx_matrix theta:  tensor([[-0.0285+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5534-0.6200j, 0.3718+0.4136j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5092+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7286-0.j, -0.6850-0.j],
        [ 0.6850+0.j,  0.7286-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5534-0.6200j, 0.3718+0.4136j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1485-0.7351j, 0.6499-0.1233j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5624, 0.4376]], grad_fn=<PowBackward0>)
loss:  0.5755674242973328
loss:  0.46213310956954956
loss:  0.24886687099933624
loss:  0.6253448724746704
----------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  rx
rx_matrix theta:  tensor([[-0.0284+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3581-0.3445j, 0.6247+0.6024j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5089+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7286-0.j, -0.6849-0.j],
        [ 0.6849+0.j,  0.7286-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3581-0.3445j, 0.6247+0.6024j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1669-0.6635j,  0.7005+0.2030j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4682, 0.5318]], grad_fn=<PowBackward0>)
loss:  0.6313964128494263
loss:  0.7160800695419312
loss:  0.46363508701324463
loss:  0.08072507381439209
----------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  rx
rx_matrix theta:  tensor([[-0.0284+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6985-0.4086j, 0.5028+0.3039j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5086+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7287-0.j, -0.6848-0.j],
        [ 0.6848+0.j,  0.7287-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6985-0.4086j, 0.5028+0.3039j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1647-0.5059j, 0.8447-0.0584j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2831, 0.7169]], grad_fn=<PowBackward0>)
loss:  0.3328017294406891
loss:  0.6341460347175598
loss:  0.6327998638153076
loss:  0.4561074674129486
----------index20----------
train inputs:  tensor([[1.6821, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6821]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6821+0.j]])
ry_matrix:  tensor([[ 0.6667-0.j, -0.7454-0.j],
        [ 0.7454+0.j,  0.6667-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5683-0.3303j, 0.6463+0.3876j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5084+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7288-0.j, -0.6847-0.j],
        [ 0.6847+0.j,  0.7288-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5683-0.3303j, 0.6463+0.3876j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0283-0.5061j,  0.8601+0.0563j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2570, 0.7430]], grad_fn=<PowBackward0>)
loss:  0.2970333695411682
loss:  0.5397334098815918
loss:  0.42104119062423706
loss:  0.6405313014984131
----------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  rx
rx_matrix theta:  tensor([[-0.0285+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4898-0.5492j, 0.4523+0.5039j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5081+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7289-0.j, -0.6846-0.j],
        [ 0.6846+0.j,  0.7289-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4898-0.5492j, 0.4523+0.5039j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0474-0.7453j, 0.6650-0.0086j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5577, 0.4423]], grad_fn=<PowBackward0>)
loss:  0.5839323997497559
loss:  0.2547766864299774
loss:  0.40727102756500244
loss:  0.3525170683860779
----------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6366-0.5683j, 0.3877+0.3486j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5078+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7290-0.j, -0.6845-0.j],
        [ 0.6845+0.j,  0.7290-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6366-0.5683j, 0.3877+0.3486j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1987-0.6529j, 0.7184-0.1349j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4658, 0.5342]], grad_fn=<PowBackward0>)
loss:  0.7640840411186218
loss:  0.7635799646377563
loss:  0.2552391290664673
loss:  0.08427631855010986
----------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2974-0.2238j, 0.7356+0.5660j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5076+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7291-0.j, -0.6844-0.j],
        [ 0.6844+0.j,  0.7291-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2974-0.2238j, 0.7356+0.5660j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2867-0.5505j,  0.7399+0.2595j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3852, 0.6148]], grad_fn=<PowBackward0>)
loss:  0.4865249991416931
loss:  0.7108626961708069
loss:  0.5743979811668396
loss:  0.45992541313171387
----------index36----------
train inputs:  tensor([[1.1512, 1.5338]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5986-0.5764j, 0.4003+0.3863j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5073+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7292-0.j, -0.6843-0.j],
        [ 0.6843+0.j,  0.7292-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5986-0.5764j, 0.4003+0.3863j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1626-0.6847j, 0.7015-0.1127j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4952, 0.5048]], grad_fn=<PowBackward0>)
loss:  0.7027632594108582
loss:  0.1919274628162384
loss:  0.296933650970459
loss:  0.6279635429382324
----------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  rx
rx_matrix theta:  tensor([[-0.0288+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0144j],
        [0.0000+0.0144j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4903-0.3420j, 0.6529+0.4652j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5070+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7293-0.j, -0.6842-0.j],
        [ 0.6842+0.j,  0.7293-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4903-0.3420j, 0.6529+0.4652j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0892-0.5677j,  0.8116+0.1053j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3303, 0.6697]], grad_fn=<PowBackward0>)
loss:  0.4008788466453552
loss:  0.349319189786911
loss:  0.9132996797561646
loss:  0.4030524790287018
----------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  rx
rx_matrix theta:  tensor([[-0.0289+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0144j],
        [0.0000+0.0144j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4759-0.1580j, 0.8138+0.2938j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5068+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7294-0.j, -0.6841-0.j],
        [ 0.6841+0.j,  0.7294-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4759-0.1580j, 0.8138+0.2938j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2097-0.3162j,  0.9191+0.1062j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1440, 0.8560]], grad_fn=<PowBackward0>)
loss:  0.15543170273303986
loss:  0.8928890824317932
loss:  0.1671788990497589
loss:  0.5385520458221436
----------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  rx
rx_matrix theta:  tensor([[-0.0289+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0145j],
        [0.0000+0.0145j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6146-0.5918j, 0.3752+0.3622j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5065+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7295-0.j, -0.6840-0.j],
        [ 0.6840+0.j,  0.7295-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6146-0.5918j, 0.3752+0.3622j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1916-0.6795j, 0.6941-0.1406j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4984, 0.5016]], grad_fn=<PowBackward0>)
loss:  0.6962563395500183
loss:  0.5760509967803955
loss:  0.7327173352241516
loss:  0.2595994174480438
----------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  rx
rx_matrix theta:  tensor([[-0.0288+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0144j],
        [0.0000+0.0144j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9058-0.3170j, 0.2612+0.1038j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5062+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7296-0.j, -0.6839-0.j],
        [ 0.6839+0.j,  0.7296-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9058-0.3170j, 0.2612+0.1038j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4822-0.3023j, 0.8100-0.1411j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3239, 0.6761]], grad_fn=<PowBackward0>)
loss:  1.127257227897644
loss:  0.6304845809936523
loss:  0.7282546162605286
loss:  0.3088016211986542
----------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  rx
rx_matrix theta:  tensor([[-0.0286+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0143j],
        [0.0000+0.0143j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6842-0.6111j, 0.2957+0.2664j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5057+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7297-0.j, -0.6837-0.j],
        [ 0.6837+0.j,  0.7297-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6842-0.6111j, 0.2957+0.2664j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2971-0.6281j, 0.6836-0.2234j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4828, 0.5172]], grad_fn=<PowBackward0>)
loss:  0.7280746102333069
loss:  0.4436132311820984
loss:  0.6476198434829712
loss:  0.40886804461479187
----------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  rx
rx_matrix theta:  tensor([[-0.0284+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0142j],
        [0.0000+0.0142j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4760-0.6243j, 0.3793+0.4897j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5052+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7299-0.j, -0.6835-0.j],
        [ 0.6835+0.j,  0.7299-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4760-0.6243j, 0.3793+0.4897j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0882-0.7904j, 0.6022-0.0693j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6326, 0.3674]], grad_fn=<PowBackward0>)
loss:  0.4579918682575226
loss:  0.5698411464691162
loss:  0.386749267578125
loss:  0.7615174055099487
----------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  rx
rx_matrix theta:  tensor([[-0.0281+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0140j],
        [0.0000+0.0140j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4780-0.6805j, 0.3239+0.4512j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5048+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7301-0.j, -0.6834-0.j],
        [ 0.6834+0.j,  0.7301-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4780-0.6805j, 0.3239+0.4512j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1277-0.8051j, 0.5631-0.1356j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6645, 0.3355]], grad_fn=<PowBackward0>)
loss:  0.40869995951652527
loss:  0.349515825510025
loss:  0.24977998435497284
loss:  0.45596715807914734
----------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  rx
rx_matrix theta:  tensor([[-0.0278+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0139j],
        [0.0000+0.0139j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6220-0.6458j, 0.3076+0.3186j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5044+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7302-0.j, -0.6832-0.j],
        [ 0.6832+0.j,  0.7302-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6220-0.6458j, 0.3076+0.3186j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2440-0.6892j, 0.6496-0.2086j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5345, 0.4655]], grad_fn=<PowBackward0>)
loss:  0.6263634562492371
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4794694185256958
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0278+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0139j],
        [0.0000+0.0139j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4512-0.3423j, 0.6527+0.5032j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5043+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7302-0.j, -0.6832-0.j],
        [ 0.6832+0.j,  0.7302-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4512-0.3423j, 0.6527+0.5032j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1165-0.5938j,  0.7849+0.1336j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3661, 0.6339]], grad_fn=<PowBackward0>)
loss:  0.4559192955493927
loss:  0.40242451429367065
loss:  0.7269226908683777
loss:  0.7304931282997131
----------index4----------
train inputs:  tensor([[2.0731, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.0731]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.0731+0.j]])
ry_matrix:  tensor([[ 0.5092-0.j, -0.8607-0.j],
        [ 0.8607+0.j,  0.5092-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4801-0.1697j, 0.8114+0.2869j]])
New state:  tensor([[0.4760-0.1585j, 0.8137+0.2935j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5040+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7303-0.j, -0.6831-0.j],
        [ 0.6831+0.j,  0.7303-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4760-0.1585j, 0.8137+0.2935j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2082-0.3162j,  0.9195+0.1061j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1433, 0.8567]], grad_fn=<PowBackward0>)
loss:  0.154714435338974
loss:  0.8187447786331177
loss:  0.6260641813278198
loss:  0.7266547679901123
----------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  rx
rx_matrix theta:  tensor([[-0.0276+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0138j],
        [0.0000+0.0138j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4781-0.6805j, 0.3237+0.4511j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5037+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7304-0.j, -0.6830-0.j],
        [ 0.6830+0.j,  0.7304-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4781-0.6805j, 0.3237+0.4511j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1282-0.8052j, 0.5630-0.1353j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6647, 0.3353]], grad_fn=<PowBackward0>)
loss:  0.40838193893432617
loss:  0.19306804239749908
loss:  0.45539453625679016
loss:  0.7603261470794678
----------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  rx
rx_matrix theta:  tensor([[-0.0275+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0137j],
        [0.0000+0.0137j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6148-0.5921j, 0.3748+0.3618j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5034+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7305-0.j, -0.6829-0.j],
        [ 0.6829+0.j,  0.7305-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6148-0.5921j, 0.3748+0.3618j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1932-0.6796j, 0.6937-0.1401j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4992, 0.5008]], grad_fn=<PowBackward0>)
loss:  0.6947447657585144
loss:  0.631851851940155
loss:  0.2967146337032318
loss:  0.4840548038482666
----------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  rx
rx_matrix theta:  tensor([[-0.0273+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0137j],
        [0.0000+0.0137j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5384-0.6033j, 0.3932+0.4377j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5031+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7306-0.j, -0.6828-0.j],
        [ 0.6828+0.j,  0.7306-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5384-0.6033j, 0.3932+0.4377j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1249-0.7396j, 0.6549-0.0921j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5627, 0.4373]], grad_fn=<PowBackward0>)
loss:  0.5750844478607178
loss:  0.6256122589111328
loss:  0.6210740208625793
loss:  0.16752804815769196
----------index20----------
train inputs:  tensor([[0.9818, 0.7902]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8114-0.3335j, 0.4397+0.1925j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5029+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7307-0.j, -0.6827-0.j],
        [ 0.6827+0.j,  0.7307-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.3335j, 0.4397+0.1925j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2928-0.3751j, 0.8752-0.0870j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2264, 0.7736]], grad_fn=<PowBackward0>)
loss:  0.2567262351512909
loss:  0.4421553909778595
loss:  0.3492978811264038
loss:  0.47534701228141785
----------index24----------
train inputs:  tensor([[3.1416, 1.4595]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[3.1416]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[3.1416+0.j]])
ry_matrix:  tensor([[-4.3711e-08-0.j, -1.0000e+00+0.j],
        [ 1.0000e+00-0.j, -4.3711e-08-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0090+0.0101j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5027+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7308-0.j, -0.6826-0.j],
        [ 0.6826+0.j,  0.7308-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0090+0.0101j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.5153-0.4477j,  0.5385+0.4940j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4660, 0.5340]], grad_fn=<PowBackward0>)
loss:  0.6273123621940613
loss:  0.2966823875904083
loss:  0.334288626909256
loss:  0.34928107261657715
----------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  rx
rx_matrix theta:  tensor([[-0.0271+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0135j],
        [0.0000+0.0135j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5656-0.4307j, 0.5565+0.4300j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5025+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7308-0.j, -0.6825-0.j],
        [ 0.6825+0.j,  0.7308-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5656-0.4307j, 0.5565+0.4300j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0335-0.6083j, 0.7928+0.0203j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3711, 0.6289]], grad_fn=<PowBackward0>)
loss:  0.4638359248638153
loss:  0.256723016500473
loss:  0.6283981800079346
loss:  0.5732467770576477
----------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  rx
rx_matrix theta:  tensor([[-0.0272+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0136j],
        [0.0000+0.0136j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5279-0.5482j, 0.4504+0.4668j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5024+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7309-0.j, -0.6825-0.j],
        [ 0.6825+0.j,  0.7309-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5279-0.5482j, 0.4504+0.4668j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0784-0.7193j, 0.6894-0.0330j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5236, 0.4764]], grad_fn=<PowBackward0>)
loss:  0.6470812559127808
loss:  0.3016989529132843
loss:  0.5834628343582153
loss:  0.4185529947280884
----------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  rx
rx_matrix theta:  tensor([[-0.0272+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0136j],
        [0.0000+0.0136j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.4157j, 0.5666+0.4006j]])
New state:  tensor([[0.5824-0.4080j, 0.5722+0.4086j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5022+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7309-0.j, -0.6825-0.j],
        [ 0.6825+0.j,  0.7309-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5824-0.4080j, 0.5722+0.4086j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0352-0.5770j, 0.8157+0.0202j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3342, 0.6658]], grad_fn=<PowBackward0>)
loss:  0.4068079888820648
loss:  1.1219125986099243
loss:  0.0836493968963623
loss:  0.4574090242385864
----------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  rx
rx_matrix theta:  tensor([[-0.0273+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0136j],
        [0.0000+0.0136j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.7201j, 0.2722+0.5092j]])
New state:  tensor([[0.3779-0.7163j, 0.2820+0.5144j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5021+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7310-0.j, -0.6824-0.j],
        [ 0.6824+0.j,  0.7310-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3779-0.7163j, 0.2820+0.5144j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0838-0.8746j, 0.4640-0.1128j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7720, 0.2280]], grad_fn=<PowBackward0>)
loss:  0.258797824382782
loss:  0.40792006254196167
loss:  0.08267882466316223
loss:  0.7093296647071838
----------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  rx
rx_matrix theta:  tensor([[-0.0272+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0136j],
        [0.0000+0.0136j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6996-0.6251j, 0.2570+0.2318j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5019+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7310-0.j, -0.6823-0.j],
        [ 0.6823+0.j,  0.7310-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6996-0.6251j, 0.2570+0.2318j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3361-0.6151j, 0.6653-0.2571j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4913, 0.5087]], grad_fn=<PowBackward0>)
loss:  0.7106385231018066
loss:  0.8895532488822937
loss:  0.5720926523208618
loss:  0.8174006938934326
----------index48----------
train inputs:  tensor([[0.3873, 1.2310]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7997-0.5644j, 0.1648+0.1220j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5017+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7311-0.j, -0.6823-0.j],
        [ 0.6823+0.j,  0.7311-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7997-0.5644j, 0.1648+0.1220j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4722-0.4958j, 0.6661-0.2959j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4688, 0.5312]], grad_fn=<PowBackward0>)
loss:  0.7575628757476807
loss:  0.5670270323753357
loss:  0.2119593620300293
loss:  0.45986104011535645
----------index52----------
train inputs:  tensor([[1.9904, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9904]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9904+0.j]])
ry_matrix:  tensor([[ 0.5443-0.j, -0.8389-0.j],
        [ 0.8389+0.j,  0.5443-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4379-0.3050j, 0.6891+0.4903j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5015+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7312-0.j, -0.6822-0.j],
        [ 0.6822+0.j,  0.7312-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4379-0.3050j, 0.6891+0.4903j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1499-0.5575j,  0.8026+0.1504j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3332, 0.6668]], grad_fn=<PowBackward0>)
loss:  0.40533044934272766
loss:  0.39985278248786926
loss:  0.4597902297973633
loss:  0.6384536623954773
----------index56----------
train inputs:  tensor([[0.0000, 1.3085]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.+0.j]])
ry_matrix:  tensor([[1.+0.j, -0.-0.j],
        [0.+0.j, 1.+0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0082+0.0107j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5012+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7313-0.j, -0.6821-0.j],
        [ 0.6821+0.j,  0.7313-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7934-0.6085j, 0.0082+0.0107j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5746-0.4523j, 0.5472-0.4072j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5347, 0.4653]], grad_fn=<PowBackward0>)
loss:  0.6259615421295166
loss:  0.534971296787262
loss:  0.30926838517189026
loss:  0.10239464789628983
----------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  rx
rx_matrix theta:  tensor([[-0.0269+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0135j],
        [0.0000+0.0135j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5832-0.3054j, 0.6615+0.3592j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5010+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7314-0.j, -0.6820-0.j],
        [ 0.6820+0.j,  0.7314-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5832-0.3054j, 0.6615+0.3592j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0246-0.4684j,  0.8815+0.0545j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2200, 0.7800]], grad_fn=<PowBackward0>)
loss:  0.24841547012329102
loss:  0.9096401929855347
loss:  0.34911102056503296
loss:  0.2497652918100357
----------index64----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2485-0.2030j, 0.7286+0.6052j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5008+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7314-0.j, -0.6819-0.j],
        [ 0.6819+0.j,  0.7314-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2485-0.2030j, 0.7286+0.6052j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3151-0.5611j,  0.7023+0.3042j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4142, 0.5858]], grad_fn=<PowBackward0>)
loss:  0.534708559513092
loss:  0.7001093626022339
loss:  0.35087913274765015
loss:  0.7603839039802551
----------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  rx
rx_matrix theta:  tensor([[-0.0268+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3544-0.2241j, 0.7603+0.4962j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5005+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7315-0.j, -0.6818-0.j],
        [ 0.6818+0.j,  0.7315-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3544-0.2241j, 0.7603+0.4962j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2592-0.5022j,  0.7978+0.2102j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3194, 0.6806]], grad_fn=<PowBackward0>)
loss:  0.38474348187446594
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4783799946308136
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0268+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5827-0.1554j, 0.7657+0.2238j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5005+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7315-0.j, -0.6818-0.j],
        [ 0.6818+0.j,  0.7315-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5827-0.1554j, 0.7657+0.2238j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0958-0.2663j,  0.9574+0.0578j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0801, 0.9199]], grad_fn=<PowBackward0>)
loss:  0.08346128463745117
loss:  0.4408712685108185
loss:  0.566021740436554
loss:  0.47569090127944946
----------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  rx
rx_matrix theta:  tensor([[-0.0268+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0082+0.0107j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5003+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7316-0.j, -0.6818-0.j],
        [ 0.6818+0.j,  0.7316-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7934-0.6085j, 0.0082+0.0107j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5749-0.4524j, 0.5469-0.4071j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5352, 0.4648]], grad_fn=<PowBackward0>)
loss:  0.6251477599143982
loss:  0.3093539774417877
loss:  0.6191381216049194
loss:  0.7268252968788147
----------index8----------
train inputs:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4783-0.3050j, 0.6891+0.4509j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5002+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7316-0.j, -0.6817-0.j],
        [ 0.6817+0.j,  0.7316-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4783-0.3050j, 0.6891+0.4509j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1198-0.5306j,  0.8302+0.1219j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2959, 0.7041]], grad_fn=<PowBackward0>)
loss:  0.35077348351478577
loss:  0.6249691247940063
loss:  0.29652008414268494
loss:  0.6304250955581665
----------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  rx
rx_matrix theta:  tensor([[-0.0269+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5385-0.6034j, 0.3930+0.4376j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5000+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7317-0.j, -0.6816-0.j],
        [ 0.6816+0.j,  0.7317-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5385-0.6034j, 0.3930+0.4376j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1261-0.7398j, 0.6546-0.0911j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5631, 0.4369]], grad_fn=<PowBackward0>)
loss:  0.574230432510376
loss:  0.7558515071868896
loss:  0.723902702331543
loss:  0.3844483196735382
----------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  rx
rx_matrix theta:  tensor([[-0.0268+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8606+0.0068j, 0.5091+0.0115j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4999+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7317-0.j, -0.6816-0.j],
        [ 0.6816+0.j,  0.7317-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8606+0.0068j, 0.5091+0.0115j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2827-0.0029j, 0.9591+0.0131j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0799, 0.9201]], grad_fn=<PowBackward0>)
loss:  0.08330941945314407
loss:  0.4597456753253937
loss:  0.2121174931526184
loss:  0.3490002453327179
----------index20----------
train inputs:  tensor([[0.7902, 1.4595]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.7902]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.7902+0.j]])
ry_matrix:  tensor([[ 0.9230-0.j, -0.3849-0.j],
        [ 0.3849+0.j,  0.9230-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6844-0.6114j, 0.2951+0.2658j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4997+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7318-0.j, -0.6815-0.j],
        [ 0.6815+0.j,  0.7318-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6844-0.6114j, 0.2951+0.2658j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2997-0.6286j, 0.6824-0.2222j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4849, 0.5151]], grad_fn=<PowBackward0>)
loss:  0.7237372398376465
loss:  0.757186233997345
loss:  0.9088773131370544
loss:  0.692955493927002
----------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  rx
rx_matrix theta:  tensor([[-0.0267+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0134j],
        [0.0000+0.0134j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6369-0.5687j, 0.3871+0.3480j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4996+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7318-0.j, -0.6815-0.j],
        [ 0.6815+0.j,  0.7318-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6369-0.5687j, 0.3871+0.3480j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2023-0.6533j, 0.7174-0.1329j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4677, 0.5323]], grad_fn=<PowBackward0>)
loss:  0.759860634803772
loss:  0.6466248631477356
loss:  0.29648706316947937
loss:  0.10208236426115036
----------index28----------
train inputs:  tensor([[1.9106, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4581-0.3514j, 0.6479+0.4969j]])
New state:  tensor([[0.4515-0.3427j, 0.6525+0.5029j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4994+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7319-0.j, -0.6814-0.j],
        [ 0.6814+0.j,  0.7319-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4515-0.3427j, 0.6525+0.5029j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1142-0.5936j,  0.7852+0.1346j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3654, 0.6346]], grad_fn=<PowBackward0>)
loss:  0.4546819031238556
loss:  0.6234927773475647
loss:  0.4047084450721741
loss:  0.16784721612930298
----------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  rx
rx_matrix theta:  tensor([[-0.0265+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0133j],
        [0.0000+0.0133j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2979-0.2245j, 0.7354+0.5657j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4993+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7319-0.j, -0.6814-0.j],
        [ 0.6814+0.j,  0.7319-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2979-0.2245j, 0.7354+0.5657j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2830-0.5498j,  0.7413+0.2611j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3824, 0.6176]], grad_fn=<PowBackward0>)
loss:  0.4818391501903534
loss:  0.708530604839325
loss:  0.5832066535949707
loss:  0.24976001679897308
----------index36----------
train inputs:  tensor([[1.3085, 1.8331]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3085]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3085+0.j]])
ry_matrix:  tensor([[ 0.7935-0.j, -0.6086-0.j],
        [ 0.6086+0.j,  0.7935-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4765-0.6247j, 0.3787+0.4893j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4992+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7320-0.j, -0.6813-0.j],
        [ 0.6813+0.j,  0.7320-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4765-0.6247j, 0.3787+0.4893j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0908-0.7906j, 0.6018-0.0675j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6333, 0.3667]], grad_fn=<PowBackward0>)
loss:  0.4568617641925812
loss:  0.3489275872707367
loss:  0.4172457158565521
loss:  0.4012044370174408
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5687-0.6370j, 0.3479+0.3871j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4990+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7320-0.j, -0.6813-0.j],
        [ 0.6813+0.j,  0.7320-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5687-0.6370j, 0.3479+0.3871j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1793-0.7300j, 0.6421-0.1506j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5650, 0.4350]], grad_fn=<PowBackward0>)
loss:  0.5709385275840759
loss:  0.533555269241333
loss:  0.6268213987350464
loss:  0.33517929911613464
----------index44----------
train inputs:  tensor([[2.4619, 1.3845]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2486-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4989+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7321-0.j, -0.6812-0.j],
        [ 0.6812+0.j,  0.7321-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2486-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3143-0.5610j,  0.7027+0.3046j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4134, 0.5866]], grad_fn=<PowBackward0>)
loss:  0.5334922671318054
loss:  0.25823765993118286
loss:  0.6377249360084534
loss:  0.8874703049659729
----------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  rx
rx_matrix theta:  tensor([[-0.0265+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9059-0.3173j, 0.2608+0.1027j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4988+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7321-0.j, -0.6812-0.j],
        [ 0.6812+0.j,  0.7321-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9059-0.3173j, 0.2608+0.1027j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4856-0.3023j, 0.8081-0.1410j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3271, 0.6729]], grad_fn=<PowBackward0>)
loss:  1.1173481941223145
loss:  0.5719999670982361
loss:  0.4590243995189667
loss:  0.30184879899024963
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8091-0.2805j, 0.4838+0.1804j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4987+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7321-0.j, -0.6811-0.j],
        [ 0.6811+0.j,  0.7321-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8091-0.2805j, 0.4838+0.1804j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2629-0.3283j, 0.9053-0.0590j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1769, 0.8231]], grad_fn=<PowBackward0>)
loss:  0.19463351368904114
loss:  0.24829551577568054
loss:  0.15333975851535797
loss:  0.25781625509262085
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5769-0.3697j, 0.6090+0.3996j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4986+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7322-0.j, -0.6811-0.j],
        [ 0.6811+0.j,  0.7322-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5769-0.3697j, 0.6090+0.3996j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0076-0.5429j, 0.8388+0.0408j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2948, 0.7052]], grad_fn=<PowBackward0>)
loss:  0.34922003746032715
loss:  0.4546959102153778
loss:  0.6992347240447998
loss:  0.8153411149978638
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4985+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7322-0.j, -0.6811-0.j],
        [ 0.6811+0.j,  0.7322-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1301-0.8055j, 0.5626-0.1336j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6657, 0.3343]], grad_fn=<PowBackward0>)
loss:  0.40691497921943665
loss:  0.8153111934661865
loss:  0.6229464411735535
loss:  0.40695303678512573
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4147-0.4309j, 0.5563+0.5769j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4984+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7322-0.j, -0.6810-0.j],
        [ 0.6810+0.j,  0.7322-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4147-0.4309j, 0.5563+0.5769j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0752-0.7084j,  0.6898+0.1289j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5075, 0.4925]], grad_fn=<PowBackward0>)
loss:  0.7083468437194824
loss:  0.4068755805492401
loss:  0.25809675455093384
loss:  0.39928457140922546
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5658-0.4309j, 0.5563+0.4298j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4983+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7323-0.j, -0.6810-0.j],
        [ 0.6810+0.j,  0.7323-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5658-0.4309j, 0.5563+0.4298j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0354-0.6082j, 0.7927+0.0212j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3712, 0.6288]], grad_fn=<PowBackward0>)
loss:  0.4639754593372345
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4777366518974304
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-3.2581e-08+2.9141e-08j,  7.4536e-01+6.6667e-01j]])
New state:  tensor([[-0.0088+0.0098j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4983+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7323-0.j, -0.6810-0.j],
        [ 0.6810+0.j,  0.7323-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[-0.0088+0.0098j,  0.7453+0.6666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.5140-0.4468j,  0.5398+0.4948j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4638, 0.5362]], grad_fn=<PowBackward0>)
loss:  0.6231943964958191
loss:  0.46397602558135986
loss:  0.7591708302497864
loss:  0.21226413547992706
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4652-0.3245j, 0.6710+0.4776j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4982+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7323-0.j, -0.6810-0.j],
        [ 0.6810+0.j,  0.7323-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4652-0.3245j, 0.6710+0.4776j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1163-0.5629j,  0.8081+0.1287j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3303, 0.6697]], grad_fn=<PowBackward0>)
loss:  0.40099409222602844
loss:  0.15323269367218018
loss:  0.6231285929679871
loss:  0.24975313246250153
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3545-0.2242j, 0.7602+0.4961j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4982+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7323-0.j, -0.6810-0.j],
        [ 0.6810+0.j,  0.7323-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3545-0.2242j, 0.7602+0.4961j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2581-0.5020j,  0.7981+0.2106j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3186, 0.6814]], grad_fn=<PowBackward0>)
loss:  0.38366612792015076
loss:  0.08319883793592453
loss:  0.40434321761131287
loss:  0.5329574346542358
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5207-0.1375j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4981+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7323-0.j, -0.6809-0.j],
        [ 0.6809+0.j,  0.7323-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5207-0.1375j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1696-0.2608j,  0.9471+0.0786j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0968, 0.9032]], grad_fn=<PowBackward0>)
loss:  0.10181479901075363
loss:  0.45883631706237793
loss:  0.3502984642982483
loss:  0.4067992866039276
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4980+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7324-0.j, -0.6809-0.j],
        [ 0.6809+0.j,  0.7324-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4784-0.6807j, 0.3233+0.4508j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1302-0.8055j, 0.5625-0.1334j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6658, 0.3342]], grad_fn=<PowBackward0>)
loss:  0.4067958891391754
loss:  0.699043333530426
loss:  0.4395582973957062
loss:  0.2963971793651581
----------index20----------
train inputs:  tensor([[1.8331, 1.2310]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4908-0.3428j, 0.6525+0.4646j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4980+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7324-0.j, -0.6809-0.j],
        [ 0.6809+0.j,  0.7324-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4908-0.3428j, 0.6525+0.4646j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0848-0.5674j,  0.8120+0.1069j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3292, 0.6708]], grad_fn=<PowBackward0>)
loss:  0.39922067523002625
loss:  0.8150156736373901
loss:  0.45460641384124756
loss:  0.5640146136283875
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6222-0.6460j, 0.3072+0.3181j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4979+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7324-0.j, -0.6809-0.j],
        [ 0.6809+0.j,  0.7324-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6222-0.6460j, 0.3072+0.3181j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2466-0.6897j, 0.6486-0.2069j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5365, 0.4635]], grad_fn=<PowBackward0>)
loss:  0.6226667761802673
loss:  0.8149797320365906
loss:  0.6263152956962585
loss:  0.2580093443393707
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6788-0.5184j, 0.4109+0.3189j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4979+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7324-0.j, -0.6809-0.j],
        [ 0.6809+0.j,  0.7324-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6788-0.5184j, 0.4109+0.3189j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2174-0.5968j, 0.7631-0.1194j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4034, 0.5966]], grad_fn=<PowBackward0>)
loss:  0.9078078866004944
loss:  0.5716949701309204
loss:  0.2586330473423004
loss:  0.4069657325744629
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2486-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4978+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7324-0.j, -0.6808-0.j],
        [ 0.6808+0.j,  0.7324-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2486-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3139-0.5608j,  0.7029+0.3049j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4130, 0.5870]], grad_fn=<PowBackward0>)
loss:  0.5327537655830383
loss:  0.3492010235786438
loss:  0.7244806289672852
loss:  0.7223396301269531
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8606+0.0067j, 0.5091+0.0114j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4978+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6808-0.j],
        [ 0.6808+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8606+0.0067j, 0.5091+0.0114j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2837-0.0028j, 0.9588+0.0129j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0805, 0.9195]], grad_fn=<PowBackward0>)
loss:  0.08392809331417084
loss:  0.34879645705223083
loss:  0.6173301935195923
loss:  0.7222987413406372
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6150-0.3587j, 0.6020+0.3615j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4977+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6808-0.j],
        [ 0.6808+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6150-0.3587j, 0.6020+0.3615j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0407-0.5088j, 0.8597+0.0205j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2606, 0.7394]], grad_fn=<PowBackward0>)
loss:  0.3018812835216522
loss:  0.2579861879348755
loss:  0.6225165724754333
loss:  0.4761049151420593
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9059-0.3173j, 0.2608+0.1027j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4976+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6808-0.j],
        [ 0.6808+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9059-0.3173j, 0.2608+0.1027j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4860-0.3024j, 0.8078-0.1408j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3277, 0.6723]], grad_fn=<PowBackward0>)
loss:  1.1157996654510498
loss:  0.29637354612350464
loss:  0.3487817645072937
loss:  0.637354850769043
----------index48----------
train inputs:  tensor([[1.6078, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5448-0.4147j, 0.5769+0.4454j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4976+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6808-0.j],
        [ 0.6808+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5448-0.4147j, 0.5769+0.4454j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0063-0.6070j, 0.7934+0.0440j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3685, 0.6315]], grad_fn=<PowBackward0>)
loss:  0.45969149470329285
loss:  0.6293280124664307
loss:  0.33551621437072754
loss:  0.7081038951873779
----------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  rx
rx_matrix theta:  tensor([[-0.0264+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3782-0.2627j, 0.7236+0.5142j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4975+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3782-0.2627j, 0.7236+0.5142j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2156-0.5424j,  0.7875+0.1979j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3407, 0.6593]], grad_fn=<PowBackward0>)
loss:  0.4165915846824646
loss:  0.5830799341201782
loss:  0.7534023523330688
loss:  0.7553770542144775
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6960-0.5317j, 0.3811+0.2961j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4975+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7325-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7325-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6960-0.5317j, 0.3811+0.2961j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2504-0.5911j, 0.7529-0.1451j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4121, 0.5879]], grad_fn=<PowBackward0>)
loss:  0.8865583539009094
loss:  0.309658408164978
loss:  0.19501526653766632
loss:  0.4565594792366028
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0132j],
        [0.0000+0.0132j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5386-0.6035j, 0.3929+0.4375j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4974+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5386-0.6035j, 0.3929+0.4375j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1272-0.7399j, 0.6544-0.0903j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5635, 0.4365]], grad_fn=<PowBackward0>)
loss:  0.5735024213790894
loss:  0.6919187903404236
loss:  0.7070777416229248
loss:  0.45415470004081726
----------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  rx
rx_matrix theta:  tensor([[-0.0263+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5281-0.5485j, 0.4501+0.4666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4974+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5281-0.5485j, 0.4501+0.4666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0805-0.7194j, 0.6892-0.0315j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5240, 0.4760]], grad_fn=<PowBackward0>)
loss:  0.6462744474411011
loss:  0.24822530150413513
loss:  0.5702489018440247
loss:  0.16802537441253662
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2980-0.2246j, 0.7354+0.5656j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4973+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2980-0.2246j, 0.7354+0.5656j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2822-0.5496j,  0.7416+0.2615j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3817, 0.6183]], grad_fn=<PowBackward0>)
loss:  0.48072460293769836
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.4774649441242218
------------------------------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4652-0.3246j, 0.6710+0.4775j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4973+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6807-0.j],
        [ 0.6807+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4652-0.3246j, 0.6710+0.4775j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1159-0.5628j,  0.8082+0.1289j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3302, 0.6698]], grad_fn=<PowBackward0>)
loss:  0.40077677369117737
loss:  0.29635974764823914
loss:  0.35012733936309814
loss:  0.6462598443031311
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2487-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4973+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2487-0.2032j, 0.7285+0.6051j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3137-0.5607j,  0.7030+0.3050j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4128, 0.5872]], grad_fn=<PowBackward0>)
loss:  0.5324140787124634
loss:  0.16802911460399628
loss:  0.4565276801586151
loss:  0.7080385684967041
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6845-0.6115j, 0.2949+0.2656j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4973+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6845-0.6115j, 0.2949+0.2656j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3007-0.6288j, 0.6820-0.2216j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4858, 0.5142]], grad_fn=<PowBackward0>)
loss:  0.721976637840271
loss:  0.5324039459228516
loss:  0.6169982552528381
loss:  0.7069743871688843
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5386-0.6035j, 0.3928+0.4374j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4973+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5386-0.6035j, 0.3928+0.4374j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1272-0.7399j, 0.6544-0.0903j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5636, 0.4364]], grad_fn=<PowBackward0>)
loss:  0.5734538435935974
loss:  0.4585864245891571
loss:  0.4541243016719818
loss:  0.3492000102996826
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5207-0.1376j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5207-0.1376j, 0.8091+0.2352j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1692-0.2608j,  0.9472+0.0786j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0967, 0.9033]], grad_fn=<PowBackward0>)
loss:  0.10164719074964523
loss:  0.5830503702163696
loss:  0.7531328201293945
loss:  0.5714757442474365
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4120-0.6412j, 0.3559+0.5409j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4120-0.6412j, 0.3559+0.5409j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0596-0.8379j, 0.5411-0.0401j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7056, 0.2944]], grad_fn=<PowBackward0>)
loss:  0.3487371504306793
loss:  0.4069945812225342
loss:  0.7219371199607849
loss:  0.30967944860458374
----------index24----------
train inputs:  tensor([[1.6078, 0.9818]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6075-0.3188j, 0.6393+0.3474j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6075-0.3188j, 0.6393+0.3474j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0099-0.4700j, 0.8818+0.0376j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2210, 0.7790]], grad_fn=<PowBackward0>)
loss:  0.24974876642227173
loss:  0.5634194612503052
loss:  0.4806658923625946
loss:  0.7239214181900024
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6788-0.5185j, 0.4108+0.3188j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6788-0.5185j, 0.4108+0.3188j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2177-0.5968j, 0.7630-0.1193j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4036, 0.5964]], grad_fn=<PowBackward0>)
loss:  0.9073961973190308
loss:  0.6222150325775146
loss:  0.7586469650268555
loss:  0.3356127440929413
----------index32----------
train inputs:  tensor([[0.8897, 1.6078]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6222-0.6460j, 0.3071+0.3180j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7326-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7326-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6222-0.6460j, 0.3071+0.3180j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2469-0.6898j, 0.6485-0.2067j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5367, 0.4633]], grad_fn=<PowBackward0>)
loss:  0.6222280263900757
loss:  0.6222253441810608
loss:  0.8145030736923218
loss:  0.88633793592453
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3782-0.2627j, 0.7236+0.5142j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4972+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3782-0.2627j, 0.7236+0.5142j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2154-0.5424j,  0.7875+0.1979j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3406, 0.6594]], grad_fn=<PowBackward0>)
loss:  0.41644448041915894
loss:  0.6291394829750061
loss:  0.6259813904762268
loss:  0.2589004933834076
----------index40----------
train inputs:  tensor([[1.0685, 0.6797]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8092-0.2806j, 0.4838+0.1803j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8092-0.2806j, 0.4838+0.1803j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2636-0.3283j, 0.9051-0.0589j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1773, 0.8227]], grad_fn=<PowBackward0>)
loss:  0.19511473178863525
loss:  0.4596889615058899
loss:  0.24821613729000092
loss:  1.1151117086410522
----------index44----------
train inputs:  tensor([[1.5338, 1.0685]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6151-0.3588j, 0.6019+0.3614j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6151-0.3588j, 0.6019+0.3614j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0410-0.5088j, 0.8596+0.0206j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2606, 0.7394]], grad_fn=<PowBackward0>)
loss:  0.3019121587276459
loss:  0.7550655007362366
loss:  0.40404728055000305
loss:  0.43907734751701355
----------index48----------
train inputs:  tensor([[1.7571, 1.3085]], dtype=torch.float64)
train label:  tensor([1.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.5003-0.3804j, 0.6159+0.4751j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5003-0.3804j, 0.6159+0.4751j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0526-0.6021j,  0.7917+0.0892j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3652, 0.6348]], grad_fn=<PowBackward0>)
loss:  0.45449399948120117
loss:  0.15295663475990295
loss:  0.2963491678237915
loss:  0.3990626335144043
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6151-0.5924j, 0.3744+0.3614j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6151-0.5924j, 0.3744+0.3614j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1958-0.6800j, 0.6929-0.1384j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5007, 0.4993]], grad_fn=<PowBackward0>)
loss:  0.6917669773101807
loss:  0.38318946957588196
loss:  0.21236474812030792
loss:  0.25787094235420227
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5991-0.5769j, 0.3995+0.3856j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5991-0.5769j, 0.3995+0.3856j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1670-0.6851j, 0.7004-0.1101j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4973, 0.5027]], grad_fn=<PowBackward0>)
loss:  0.6986584663391113
loss:  0.08412796258926392
loss:  0.34872153401374817
loss:  0.46401354670524597
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5611-0.5827j, 0.4083+0.4231j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5611-0.5827j, 0.4083+0.4231j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1332-0.7149j, 0.6810-0.0865j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5288, 0.4712]], grad_fn=<PowBackward0>)
loss:  0.6371896266937256
loss:  0.5701380968093872
loss:  0.2582453787326813
loss:  0.40651777386665344
----------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  rx
rx_matrix theta:  tensor([[-0.0262+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0080+0.0104j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7934-0.6085j, 0.0080+0.0104j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5759-0.4529j, 0.5458-0.4065j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5368, 0.4632]], grad_fn=<PowBackward0>)
loss:  0.6220923066139221
loss:  0.406516432762146
loss:  0.08307888358831406
loss:  0.47620511054992676
----------index68----------
train inputs:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
train label:  tensor([0.])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

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

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6749-0.5581j, 0.3702+0.3097j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6749-0.5581j, 0.3702+0.3097j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2425-0.6197j, 0.7306-0.1529j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4429, 0.5571]], grad_fn=<PowBackward0>)
loss:  0.8144290447235107
--------------------Validation--------------------
valid set accuracy: 0.8620689511299133
valid set loss: 0.47739309072494507
--------------------Test--------------------
test input:  tensor([[1.4595, 0.7902]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6845-0.2788j, 0.6190+0.2656j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6845-0.2788j, 0.6190+0.2656j]])
New state:  tensor([[0.0803-0.3850j, 0.9194+0.0048j]])
----------Measure----------
Probability:  tensor([[0.1547, 0.8453]])
test input:  tensor([[1.4595, 0.9818]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
New state:  tensor([[0.6532-0.3436j, 0.5925+0.3228j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6532-0.3436j, 0.5925+0.3228j]])
New state:  tensor([[0.0754-0.4715j, 0.8786+0.0027j]])
----------Measure----------
Probability:  tensor([[0.2280, 0.7720]])
test input:  tensor([[1.9106, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.9106]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.9106+0.j]])
ry_matrix:  tensor([[ 0.5774-0.j, -0.8165-0.j],
        [ 0.8165+0.j,  0.5774-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.5774+0.j, 0.8165+0.j]])
New state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4785-0.3053j, 0.6890+0.4507j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4785-0.3053j, 0.6890+0.4507j]])
New state:  tensor([[-0.1183-0.5304j,  0.8304+0.1225j]])
----------Measure----------
Probability:  tensor([[0.2954, 0.7046]])
test input:  tensor([[1.1512, 1.6821]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5539-0.6205j, 0.3710+0.4130j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5539-0.6205j, 0.3710+0.4130j]])
New state:  tensor([[0.1533-0.7357j, 0.6488-0.1197j]])
----------Measure----------
Probability:  tensor([[0.5647, 0.4353]])
test input:  tensor([[1.0685, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5924-0.6151j, 0.3614+0.3744j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5924-0.6151j, 0.3614+0.3744j]])
New state:  tensor([[0.1881-0.7055j, 0.6679-0.1443j]])
----------Measure----------
Probability:  tensor([[0.5331, 0.4669]])
test input:  tensor([[1.8331, 1.0685]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.8331]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.8331+0.j]])
ry_matrix:  tensor([[ 0.6086-0.j, -0.7935-0.j],
        [ 0.7935+0.j,  0.6086-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6086+0.j, 0.7935+0.j]])
New state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
New state:  tensor([[0.5185-0.3009j, 0.6869+0.4108j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5185-0.3009j, 0.6869+0.4108j]])
New state:  tensor([[-0.0876-0.5001j,  0.8561+0.0962j]])
----------Measure----------
Probability:  tensor([[0.2578, 0.7422]])
test input:  tensor([[1.1512, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
New state:  tensor([[0.5769-0.5991j, 0.3856+0.3995j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5769-0.5991j, 0.3856+0.3995j]])
New state:  tensor([[0.1603-0.7108j, 0.6751-0.1150j]])
----------Measure----------
Probability:  tensor([[0.5310, 0.4690]])
test input:  tensor([[1.7571, 1.4595]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.7571]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.7571+0.j]])
ry_matrix:  tensor([[ 0.6383-0.j, -0.7698-0.j],
        [ 0.7698+0.j,  0.6383-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6383+0.j, 0.7698+0.j]])
New state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
New state:  tensor([[0.4690-0.4180j, 0.5793+0.5194j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4690-0.4180j, 0.5793+0.5194j]])
New state:  tensor([[-0.0506-0.6597j,  0.7436+0.0961j]])
----------Measure----------
Probability:  tensor([[0.4378, 0.5622]])
test input:  tensor([[0.8897, 1.3085]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7128-0.5448j, 0.3486+0.2712j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7128-0.5448j, 0.3486+0.2712j]])
New state:  tensor([[0.2850-0.5838j, 0.7405-0.1721j]])
----------Measure----------
Probability:  tensor([[0.4220, 0.5780]])
test input:  tensor([[1.0685, 1.6821]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5688-0.6370j, 0.3478+0.3870j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5688-0.6370j, 0.3478+0.3870j]])
New state:  tensor([[0.1800-0.7301j, 0.6419-0.1500j]])
----------Measure----------
Probability:  tensor([[0.5655, 0.4345]])
test input:  tensor([[0.8897, 1.3085]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7128-0.5448j, 0.3486+0.2712j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7128-0.5448j, 0.3486+0.2712j]])
New state:  tensor([[0.2850-0.5838j, 0.7405-0.1721j]])
----------Measure----------
Probability:  tensor([[0.4220, 0.5780]])
test input:  tensor([[1.5338, 0.8897]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
New state:  tensor([[0.6460-0.3017j, 0.6304+0.3071j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6460-0.3017j, 0.6304+0.3071j]])
New state:  tensor([[0.0444-0.4300j, 0.9015+0.0197j]])
----------Measure----------
Probability:  tensor([[0.1869, 0.8131]])
test input:  tensor([[0.8897, 1.3845]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.8897]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.8897+0.j]])
ry_matrix:  tensor([[ 0.9027-0.j, -0.4303-0.j],
        [ 0.4303+0.j,  0.9027-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9027+0.j, 0.4303+0.j]])
New state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
New state:  tensor([[0.6912-0.5718j, 0.3388+0.2837j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6912-0.5718j, 0.3388+0.2837j]])
New state:  tensor([[0.2759-0.6120j, 0.7186-0.1812j]])
----------Measure----------
Probability:  tensor([[0.4507, 0.5493]])
test input:  tensor([[2.5903, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.5903]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.5903+0.j]])
ry_matrix:  tensor([[ 0.2722-0.j, -0.9623-0.j],
        [ 0.9623+0.j,  0.2722-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.2722+0.j, 0.9623+0.j]])
New state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
New state:  tensor([[0.2214-0.1376j, 0.8091+0.5267j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2214-0.1376j, 0.8091+0.5267j]])
New state:  tensor([[-0.3884-0.4593j,  0.7435+0.2923j]])
----------Measure----------
Probability:  tensor([[0.3618, 0.6382]])
test input:  tensor([[1.0685, 1.7571]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.0685]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.0685+0.j]])
ry_matrix:  tensor([[ 0.8607-0.j, -0.5092-0.j],
        [ 0.5092+0.j,  0.8607-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
New state:  tensor([[0.5442-0.6582j, 0.3336+0.3991j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5442-0.6582j, 0.3336+0.3991j]])
New state:  tensor([[0.1717-0.7539j, 0.6148-0.1555j]])
----------Measure----------
Probability:  tensor([[0.5978, 0.4022]])
test input:  tensor([[1.4595, 0.6797]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
New state:  tensor([[0.6998-0.2402j, 0.6317+0.2314j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6998-0.2402j, 0.6317+0.2314j]])
New state:  tensor([[0.0828-0.3335j, 0.9391+0.0061j]])
----------Measure----------
Probability:  tensor([[0.1181, 0.8819]])
test input:  tensor([[0.3873, 1.4595]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.3873]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.3873+0.j]])
ry_matrix:  tensor([[ 0.9813-0.j, -0.1925-0.j],
        [ 0.1925+0.j,  0.9813-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9813+0.j, 0.1925+0.j]])
New state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
New state:  tensor([[0.7297-0.6523j, 0.1520+0.1379j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7297-0.6523j, 0.1520+0.1379j]])
New state:  tensor([[0.4312-0.5717j, 0.6080-0.3429j]])
----------Measure----------
Probability:  tensor([[0.5128, 0.4872]])
test input:  tensor([[1.4595, 2.2519]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.4595]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.4595+0.j]])
ry_matrix:  tensor([[ 0.7454-0.j, -0.6667-0.j],
        [ 0.6667+0.j,  0.7454-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7454+0.j, 0.6667+0.j]])
New state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
New state:  tensor([[0.3129-0.6690j, 0.2957+0.6059j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.3129-0.6690j, 0.2957+0.6059j]])
New state:  tensor([[0.0280-0.9025j, 0.4295-0.0113j]])
----------Measure----------
Probability:  tensor([[0.8154, 0.1846]])
test input:  tensor([[1.6078, 1.9106]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
New state:  tensor([[0.3929-0.5611j, 0.4231+0.5931j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.3929-0.5611j, 0.4231+0.5931j]])
New state:  tensor([[-7.9632e-05-0.8148j,  5.7740e-01+0.0527j]])
----------Measure----------
Probability:  tensor([[0.6638, 0.3362]])
test input:  tensor([[2.4619, 1.3085]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[2.4619]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[2.4619+0.j]])
ry_matrix:  tensor([[ 0.3333-0.j, -0.9428-0.j],
        [ 0.9428+0.j,  0.3333-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.3333+0.j, 0.9428+0.j]])
New state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
New state:  tensor([[0.2570-0.1931j, 0.7507+0.5772j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2570-0.1931j, 0.7507+0.5772j]])
New state:  tensor([[-0.3226-0.5343j,  0.7249+0.2915j]])
----------Measure----------
Probability:  tensor([[0.3895, 0.6105]])
test input:  tensor([[0.6797, 1.7571]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.6797]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.6797+0.j]])
ry_matrix:  tensor([[ 0.9428-0.j, -0.3333-0.j],
        [ 0.3333+0.j,  0.9428-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.9428+0.j, 0.3333+0.j]])
New state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
New state:  tensor([[0.5984-0.7229j, 0.2222+0.2644j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5984-0.7229j, 0.2222+0.2644j]])
New state:  tensor([[0.2872-0.7097j, 0.5701-0.2982j]])
----------Measure----------
Probability:  tensor([[0.5861, 0.4139]])
test input:  tensor([[1.5338, 1.3085]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.5338]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.5338+0.j]])
ry_matrix:  tensor([[ 0.7201-0.j, -0.6939-0.j],
        [ 0.6939+0.j,  0.7201-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7201+0.j, 0.6939+0.j]])
New state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5658-0.4310j, 0.5563+0.4297j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5658-0.4310j, 0.5563+0.4297j]])
New state:  tensor([[0.0360-0.6082j, 0.7926+0.0215j]])
----------Measure----------
Probability:  tensor([[0.3712, 0.6288]])
test input:  tensor([[1.6078, 1.1512]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5769-0.3698j, 0.6089+0.3995j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5769-0.3698j, 0.6089+0.3995j]])
New state:  tensor([[0.0083-0.5428j, 0.8388+0.0411j]])
----------Measure----------
Probability:  tensor([[0.2947, 0.7053]])
test input:  tensor([[1.3845, 1.8331]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
New state:  tensor([[0.4618-0.6057j, 0.3964+0.5126j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4618-0.6057j, 0.3964+0.5126j]])
New state:  tensor([[0.0686-0.7926j, 0.6047-0.0367j]])
----------Measure----------
Probability:  tensor([[0.6329, 0.3671]])
test input:  tensor([[1.3845, 1.6078]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.3845]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.3845+0.j]])
ry_matrix:  tensor([[ 0.7698-0.j, -0.6383-0.j],
        [ 0.6383+0.j,  0.7698-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.7698+0.j, 0.6383+0.j]])
New state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5281-0.5485j, 0.4501+0.4666j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5281-0.5485j, 0.4501+0.4666j]])
New state:  tensor([[0.0806-0.7194j, 0.6892-0.0314j]])
----------Measure----------
Probability:  tensor([[0.5240, 0.4760]])
test input:  tensor([[1.1512, 1.9106]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.1512]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.1512+0.j]])
ry_matrix:  tensor([[ 0.8389-0.j, -0.5443-0.j],
        [ 0.5443+0.j,  0.8389-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8389+0.j, 0.5443+0.j]])
New state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4785-0.6808j, 0.3232+0.4507j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4785-0.6808j, 0.3232+0.4507j]])
New state:  tensor([[0.1306-0.8055j, 0.5624-0.1330j]])
----------Measure----------
Probability:  tensor([[0.6660, 0.3340]])
test input:  tensor([[0.9818, 1.3845]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[0.9818]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[0.9818+0.j]])
ry_matrix:  tensor([[ 0.8819-0.j, -0.4714-0.j],
        [ 0.4714+0.j,  0.8819-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.8819+0.j, 0.4714+0.j]])
New state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6749-0.5581j, 0.3702+0.3097j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6749-0.5581j, 0.3702+0.3097j]])
New state:  tensor([[0.2425-0.6197j, 0.7306-0.1529j]])
----------Measure----------
Probability:  tensor([[0.4429, 0.5571]])
test input:  tensor([[1.6078, 1.2310]], dtype=torch.float64)
test label:  tensor([1])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
New state:  tensor([[0.5611-0.3929j, 0.5931+0.4231j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5611-0.3929j, 0.5931+0.4231j]])
New state:  tensor([[0.0074-0.5758j, 0.8164+0.0426j]])
----------Measure----------
Probability:  tensor([[0.3316, 0.6684]])
test input:  tensor([[1.6078, 2.4619]], dtype=torch.float64)
test label:  tensor([0])
----------Encoding----------
Encoding operations:  [{'input_idx': [0], 'func': 'ry', 'wires': [0]}, {'input_idx': [1], 'func': 'rz', 'wires': [0]}]
Will perform  ry
params:  tensor([[1.6078]], dtype=torch.float64)
Inside  ry
ry_matrix theta:  tensor([[1.6078+0.j]])
ry_matrix:  tensor([[ 0.6939-0.j, -0.7201-0.j],
        [ 0.7201+0.j,  0.6939-0.j]])
Performing matrix multiplication

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

Current state:  tensor([[0.6939+0.j, 0.7201+0.j]])
New state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
----------Ansatz----------
Inside  rx
rx_matrix theta:  tensor([[-0.0261+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0131j],
        [0.0000+0.0131j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
New state:  tensor([[0.2224-0.6510j, 0.2486+0.6819j]])
Inside  ry
ry_matrix theta:  tensor([[1.4971+0.j]])
ry_matrix:  tensor([[ 0.7327-0.j, -0.6806-0.j],
        [ 0.6806+0.j,  0.7327-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2224-0.6510j, 0.2486+0.6819j]])
New state:  tensor([[-0.0062-0.9410j,  0.3335+0.0565j]])
----------Measure----------
Probability:  tensor([[0.8856, 0.1144]])
test set accuracy: 0.8620689511299133
test set loss: 0.4773930609226227
