------------------------------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.5094985961914062
loss:  0.1597096472978592
loss:  1.0037274360656738
----------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.4557977020740509
loss:  0.10784981399774551
loss:  0.5797008872032166
loss:  0.21892358362674713
----------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.0575-0.6086j,  0.7914-0.0047j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3737, 0.6263]], grad_fn=<PowBackward0>)
loss:  0.4679199159145355
loss:  1.3454865217208862
loss:  0.35647904872894287
loss:  0.5003471374511719
----------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.6570+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.1969j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6351, 0.3649]], grad_fn=<PowBackward0>)
loss:  0.4539754390716553
loss:  0.36741381883621216
loss:  0.2621905505657196
loss:  0.7821786999702454
----------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.6558+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6764-0.j, -0.7365-0.j],
        [ 0.7365+0.j,  0.6764-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.2437-0.2662j,  0.9308+0.0579j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1302, 0.8698]], grad_fn=<PowBackward0>)
loss:  0.13954703509807587
loss:  0.7668863534927368
loss:  0.48633304238319397
loss:  0.9937266111373901
----------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.6544+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6769-0.j, -0.7360-0.j],
        [ 0.7360+0.j,  0.6769-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.2078-0.0038j, 0.9781+0.0127j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0432, 0.9568]], grad_fn=<PowBackward0>)
loss:  0.044163778424263
loss:  0.838918924331665
loss:  0.6987578868865967
loss:  0.714923083782196
----------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.6531+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6774-0.j, -0.7356-0.j],
        [ 0.7356+0.j,  0.6774-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.5544-0.4835j,  0.4982+0.4590j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5411, 0.4589]], grad_fn=<PowBackward0>)
loss:  0.7788494229316711
loss:  0.7603095769882202
loss:  0.6167263388633728
loss:  0.3106243312358856
----------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.6514+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6780-0.j, -0.7350-0.j],
        [ 0.7350+0.j,  0.6780-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.1041-0.5004j, 0.8543-0.0944j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2613, 0.7387]], grad_fn=<PowBackward0>)
loss:  0.3028365671634674
loss:  0.91496741771698
loss:  0.528991162776947
loss:  0.6416261196136475
----------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.3303-0.5683j, 0.3877+0.6463j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6499+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6786-0.j, -0.7345-0.j],
        [ 0.7345+0.j,  0.6786-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3303-0.5683j, 0.3877+0.6463j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0606-0.8603j,  0.5056+0.0211j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7439, 0.2561]], grad_fn=<PowBackward0>)
loss:  0.2958855926990509
loss:  0.9104654788970947
loss:  0.20409922301769257
loss:  0.8354112505912781
----------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.6484+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6792-0.j, -0.7340-0.j],
        [ 0.7340+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.1025j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6934, 0.3066]], grad_fn=<PowBackward0>)
loss:  0.3661268949508667
loss:  0.44190704822540283
loss:  0.7288788557052612
loss:  0.3007001578807831
----------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.6470+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.3670, 0.6330]], grad_fn=<PowBackward0>)
loss:  0.45720958709716797
loss:  0.829121470451355
loss:  0.4058370888233185
loss:  0.2555517554283142
----------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.4777-0.6802j, 0.3244+0.4516j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6456+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6802-0.j, -0.7330-0.j],
        [ 0.7330+0.j,  0.6802-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4777-0.6802j, 0.3244+0.4516j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0871-0.7937j, 0.5708-0.1914j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6375, 0.3625]], grad_fn=<PowBackward0>)
loss:  0.45015063881874084
loss:  0.7096695303916931
loss:  0.3099013566970825
loss:  0.43081918358802795
----------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.3577-0.3440j, 0.6250+0.6026j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6442+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6807-0.j, -0.7326-0.j],
        [ 0.7326+0.j,  0.6807-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3577-0.3440j, 0.6250+0.6026j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2144-0.6756j,  0.6874+0.1582j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5024, 0.4976]], grad_fn=<PowBackward0>)
loss:  0.6980270147323608
loss:  0.452579140663147
loss:  0.8305222988128662
loss:  0.38777241110801697
----------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.6429+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6812-0.j, -0.7321-0.j],
        [ 0.7321+0.j,  0.6812-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.4598-0.5361j,  0.6174+0.3464j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4988, 0.5012]], grad_fn=<PowBackward0>)
loss:  0.6908242106437683
loss:  0.20941300690174103
loss:  0.6216593980789185
loss:  0.6682256460189819
----------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.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.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.6415+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6817-0.j, -0.7316-0.j],
        [ 0.7316+0.j,  0.6817-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.2983-0.5711j, 0.7096-0.2851j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4151, 0.5849]], grad_fn=<PowBackward0>)
loss:  0.8791368007659912
loss:  0.8698205351829529
loss:  0.2871069312095642
loss:  0.9044525623321533
----------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.2797j, 0.4843+0.1819j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6399+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6823-0.j, -0.7311-0.j],
        [ 0.7311+0.j,  0.6823-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8088-0.2797j, 0.4843+0.1819j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1977-0.3238j, 0.9217-0.0804j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1439, 0.8561]], grad_fn=<PowBackward0>)
loss:  0.15540245175361633
loss:  0.5936840176582336
loss:  0.6332634687423706
loss:  0.4803386926651001
----------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.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.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.6385+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6828-0.j, -0.7306-0.j],
        [ 0.7306+0.j,  0.6828-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.0804j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5276, 0.4724]], grad_fn=<PowBackward0>)
loss:  0.7499259114265442
loss:  0.4628223776817322
loss:  0.19429729878902435
loss:  0.6284164190292358
----------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.6371+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6833-0.j, -0.7302-0.j],
        [ 0.7302+0.j,  0.6833-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.1091-0.6067j,  0.7859+0.0485j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3800, 0.6200]], grad_fn=<PowBackward0>)
loss:  0.4780062735080719
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5204064846038818
------------------------------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.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.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.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.6067-0.3174j, 0.6399+0.3487j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0526-0.4715j,  0.8803+0.0065j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2251, 0.7749]], grad_fn=<PowBackward0>)
loss:  0.2549811005592346
loss:  0.04804592952132225
loss:  0.9018800258636475
loss:  0.36441582441329956
----------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.0302+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.6358+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6837-0.j, -0.7297-0.j],
        [ 0.7297+0.j,  0.6837-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.3134-0.5148j,  0.7781+0.1771j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3632, 0.6368]], grad_fn=<PowBackward0>)
loss:  0.45133110880851746
loss:  0.7532357573509216
loss:  0.21162912249565125
loss:  0.8239145874977112
----------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.3084+0.3194j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6348+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6841-0.j, -0.7294-0.j],
        [ 0.7294+0.j,  0.6841-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6216-0.6454j, 0.3084+0.3194j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2003-0.6744j, 0.6644-0.2523j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4950, 0.5050]], grad_fn=<PowBackward0>)
loss:  0.7032274603843689
loss:  0.10337681323289871
loss:  0.3005412518978119
loss:  0.6776406168937683
----------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.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.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6362-0.5679j, 0.3883+0.3492j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6337+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6845-0.j, -0.7290-0.j],
        [ 0.7290+0.j,  0.6845-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6362-0.5679j, 0.3883+0.3492j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1525-0.6433j, 0.7296-0.1749j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4371, 0.5629]], grad_fn=<PowBackward0>)
loss:  0.8275740742683411
loss:  0.7577943205833435
loss:  0.4281592071056366
loss:  0.6109228730201721
----------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.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.3054-0.2342j, 0.7324+0.5617j]])
New state:  tensor([[0.2967-0.2229j, 0.7359+0.5664j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6325+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6850-0.j, -0.7286-0.j],
        [ 0.7286+0.j,  0.6850-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2967-0.2229j, 0.7359+0.5664j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3330-0.5653j,  0.7202+0.2256j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4304, 0.5696]], grad_fn=<PowBackward0>)
loss:  0.5628563165664673
loss:  0.6280016303062439
loss:  0.6884409189224243
loss:  0.2849479615688324
----------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.0313+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0156j],
        [0.0000+0.0156j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.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.6311+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6855-0.j, -0.7281-0.j],
        [ 0.7281+0.j,  0.6855-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.1981-0.5807j, 0.7683-0.1824j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3764, 0.6236]], grad_fn=<PowBackward0>)
loss:  0.9770058393478394
loss:  0.19200395047664642
loss:  0.4994240999221802
loss:  0.3635670840740204
----------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.0317+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.4516+0.4680j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6297+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6860-0.j, -0.7276-0.j],
        [ 0.7276+0.j,  0.6860-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5268-0.5472j, 0.4516+0.4680j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0328-0.7159j, 0.6931-0.0771j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5136, 0.4864]], grad_fn=<PowBackward0>)
loss:  0.6662369966506958
loss:  0.4808303415775299
loss:  0.753739058971405
loss:  0.6167298555374146
----------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.0325+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0162j],
        [0.0000+0.0162j, 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.2769j, 0.6199+0.2677j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6284+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6864-0.j, -0.7272-0.j],
        [ 0.7272+0.j,  0.6864-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6837-0.2769j, 0.6199+0.2677j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0185-0.3847j, 0.9227-0.0175j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1484, 0.8516]], grad_fn=<PowBackward0>)
loss:  0.16060258448123932
loss:  0.8184995055198669
loss:  0.4764007031917572
loss:  0.4914815425872803
----------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.0331+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6777-0.5170j, 0.4126+0.3211j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6272+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6869-0.j, -0.7268-0.j],
        [ 0.7268+0.j,  0.6869-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6777-0.5170j, 0.4126+0.3211j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1656-0.5885j, 0.7760-0.1552j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3738, 0.6262]], grad_fn=<PowBackward0>)
loss:  0.9840813279151917
loss:  0.7508484721183777
loss:  0.47454991936683655
loss:  0.8952137231826782
----------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.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.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5642-0.4289j, 0.5579+0.4318j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6258+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6874-0.j, -0.7263-0.j],
        [ 0.7263+0.j,  0.6874-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5642-0.4289j, 0.5579+0.4318j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0173-0.6085j,  0.7933-0.0147j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3705, 0.6295]], grad_fn=<PowBackward0>)
loss:  0.4628749191761017
loss:  0.25895828008651733
loss:  0.44605553150177
loss:  0.3080550730228424
----------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.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.6245+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6879-0.j, -0.7258-0.j],
        [ 0.7258+0.j,  0.6879-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.0795-0.5085j,  0.8569+0.0292j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2649, 0.7351]], grad_fn=<PowBackward0>)
loss:  0.3076968789100647
loss:  0.8098136186599731
loss:  0.8845630288124084
loss:  0.4431217312812805
----------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.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.6108-0.4685j, 0.5065+0.3884j]])
New state:  tensor([[0.6042-0.4599j, 0.5143+0.3987j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6232+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6883-0.j, -0.7254-0.j],
        [ 0.7254+0.j,  0.6883-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6042-0.4599j, 0.5143+0.3987j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0428-0.6058j, 0.7923-0.0591j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3688, 0.6312]], grad_fn=<PowBackward0>)
loss:  0.4601021707057953
loss:  0.5921895503997803
loss:  0.6208909153938293
loss:  0.7452070713043213
----------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.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.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3565-0.3428j, 0.6256+0.6033j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6219+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6888-0.j, -0.7250-0.j],
        [ 0.7250+0.j,  0.6888-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3565-0.3428j, 0.6256+0.6033j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2080-0.6735j,  0.6894+0.1671j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4968, 0.5032]], grad_fn=<PowBackward0>)
loss:  0.6868553757667542
loss:  0.7084087133407593
loss:  0.35439732670783997
loss:  1.2890925407409668
----------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.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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4634-0.3221j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6205+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6893-0.j, -0.7245-0.j],
        [ 0.7245+0.j,  0.6893-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4634-0.3221j, 0.6722+0.4793j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1675-0.5692j,  0.7991+0.0971j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3521, 0.6479]], grad_fn=<PowBackward0>)
loss:  0.4339801073074341
loss:  0.8472163081169128
loss:  0.6938518285751343
loss:  0.20511114597320557
----------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.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.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1376-0.1101j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6188+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6899-0.j, -0.7239-0.j],
        [ 0.7239+0.j,  0.6899-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1376-0.1101j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4533-0.5311j,  0.6221+0.3541j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4876, 0.5124]], grad_fn=<PowBackward0>)
loss:  0.6685630083084106
loss:  0.1295611709356308
loss:  0.46559393405914307
loss:  0.8575659990310669
----------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.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.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7532-0.3527j, 0.4973+0.2469j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6171+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6905-0.j, -0.7233-0.j],
        [ 0.7233+0.j,  0.6905-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7532-0.3527j, 0.4973+0.2469j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1604-0.4221j, 0.8882-0.0846j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2039, 0.7961]], grad_fn=<PowBackward0>)
loss:  0.22806796431541443
loss:  0.30682826042175293
loss:  0.3803804814815521
loss:  0.4408596158027649
----------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.0333+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0167j],
        [0.0000+0.0167j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

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

Current state:  tensor([[0.3053-0.2096j, 0.7572+0.5380j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3363-0.5338j,  0.7440+0.2203j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3980, 0.6020]], grad_fn=<PowBackward0>)
loss:  0.5075270533561707
loss:  0.2982226014137268
loss:  0.6187458634376526
loss:  0.40569058060646057
----------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.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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8085-0.2789j, 0.4848+0.1832j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6146+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6915-0.j, -0.7224-0.j],
        [ 0.7224+0.j,  0.6915-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8085-0.2789j, 0.4848+0.1832j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2089-0.3252j, 0.9193-0.0748j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1494, 0.8506]], grad_fn=<PowBackward0>)
loss:  0.16176094114780426
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5130218863487244
------------------------------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.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.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5265-0.5469j, 0.4520+0.4684j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6143+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6915-0.j, -0.7223-0.j],
        [ 0.7223+0.j,  0.6915-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5265-0.5469j, 0.4520+0.4684j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0375-0.7166j, 0.6929-0.0711j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5149, 0.4851]], grad_fn=<PowBackward0>)
loss:  0.663855791091919
loss:  0.4627864956855774
loss:  0.22876520454883575
loss:  0.257703959941864
----------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.0331+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0166j],
        [0.0000+0.0166j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2466-0.2007j, 0.7292+0.6059j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6137+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6918-0.j, -0.7221-0.j],
        [ 0.7221+0.j,  0.6918-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2466-0.2007j, 0.7292+0.6059j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3560-0.5764j,  0.6825+0.2742j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4590, 0.5410]], grad_fn=<PowBackward0>)
loss:  0.6142706274986267
loss:  0.1610756814479828
loss:  0.42362552881240845
loss:  0.4737115204334259
----------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.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.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6358-0.5675j, 0.3889+0.3499j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6131+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.6358-0.5675j, 0.3889+0.3499j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1593-0.6453j, 0.7281-0.1675j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4418, 0.5582]], grad_fn=<PowBackward0>)
loss:  0.8169199824333191
loss:  0.744088888168335
loss:  0.5502188801765442
loss:  0.20532673597335815
----------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.0327+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0163j],
        [0.0000+0.0163j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.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.6123+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6923-0.j, -0.7216-0.j],
        [ 0.7216+0.j,  0.6923-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.3077-0.5757j, 0.7056-0.2757j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4262, 0.5738]], grad_fn=<PowBackward0>)
loss:  0.8529520630836487
loss:  0.3003692328929901
loss:  0.6891687512397766
loss:  0.8859983086585999
----------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.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.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3765-0.2604j, 0.7244+0.5154j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6113+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6926-0.j, -0.7213-0.j],
        [ 0.7213+0.j,  0.6926-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3765-0.2604j, 0.7244+0.5154j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2617-0.5521j,  0.7734+0.1692j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3733, 0.6267]], grad_fn=<PowBackward0>)
loss:  0.46727651357650757
loss:  0.4931846559047699
loss:  0.09923601895570755
loss:  0.43821901082992554
----------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.0327+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0163j],
        [0.0000+0.0163j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7787-0.5972j, 0.1527+0.1171j]])
New state:  tensor([[0.7766-0.5946j, 0.1624+0.1298j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6102+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6930-0.j, -0.7209-0.j],
        [ 0.7209+0.j,  0.6930-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7766-0.5946j, 0.1624+0.1298j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4211-0.5057j, 0.6725-0.3387j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4331, 0.5669]], grad_fn=<PowBackward0>)
loss:  0.836849570274353
loss:  0.2801380157470703
loss:  0.4769573509693146
loss:  0.6804207563400269
----------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.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.8140-0.3395j, 0.4351+0.1814j]])
New state:  tensor([[0.8109-0.3323j, 0.4406+0.1947j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6090+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6935-0.j, -0.7205-0.j],
        [ 0.7205+0.j,  0.6935-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8109-0.3323j, 0.4406+0.1947j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2449-0.3707j, 0.8898-0.1043j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1974, 0.8026]], grad_fn=<PowBackward0>)
loss:  0.21992455422878265
loss:  0.35361137986183167
loss:  0.8840726613998413
loss:  0.30589109659194946
----------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.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.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.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.3289-0.5675j, 0.3889+0.6470j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0518-0.8596j,  0.5067+0.0402j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7417, 0.2583]], grad_fn=<PowBackward0>)
loss:  0.2988334894180298
loss:  0.4854646921157837
loss:  0.05467710271477699
loss:  0.4618383049964905
----------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.0327+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.6073+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6941-0.j, -0.7199-0.j],
        [ 0.7199+0.j,  0.6941-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.4401-0.2957j, 0.8337-0.1546j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2811, 0.7189]], grad_fn=<PowBackward0>)
loss:  1.2690508365631104
loss:  0.2532927691936493
loss:  0.6035049557685852
loss:  0.4380094110965729
----------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.0327+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.6064+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6944-0.j, -0.7196-0.j],
        [ 0.7196+0.j,  0.6944-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.0089-0.5774j,  0.8164-0.0076j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3334, 0.6666]], grad_fn=<PowBackward0>)
loss:  0.405629426240921
loss:  0.8653340935707092
loss:  0.3605108857154846
loss:  0.1840156614780426
----------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.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.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5433-0.4129j, 0.5782+0.4472j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6055+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.5433-0.4129j, 0.5782+0.4472j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0384-0.6085j,  0.7925+0.0137j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3717, 0.6283]], grad_fn=<PowBackward0>)
loss:  0.4647803008556366
loss:  0.685217559337616
loss:  0.7279176115989685
loss:  0.4374225437641144
----------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.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.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6502-0.6750j, 0.2424+0.2507j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6044+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6951-0.j, -0.7189-0.j],
        [ 0.7189+0.j,  0.6951-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6502-0.6750j, 0.2424+0.2507j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2777-0.6495j, 0.6359-0.3110j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4989, 0.5011]], grad_fn=<PowBackward0>)
loss:  0.6953100562095642
loss:  0.3769761919975281
loss:  0.7926955819129944
loss:  0.5907694101333618
----------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.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.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6138-0.5911j, 0.3765+0.3635j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6031+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6956-0.j, -0.7184-0.j],
        [ 0.7184+0.j,  0.6956-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6138-0.5911j, 0.3765+0.3635j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1565-0.6723j, 0.7029-0.1718j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4765, 0.5235]], grad_fn=<PowBackward0>)
loss:  0.7413550615310669
loss:  0.6540251970291138
loss:  0.9695075154304504
loss:  0.42865779995918274
----------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.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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6949-0.5304j, 0.3829+0.2985j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6018+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6961-0.j, -0.7180-0.j],
        [ 0.7180+0.j,  0.6961-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5304j, 0.3829+0.2985j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2088-0.5835j, 0.7655-0.1730j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3841, 0.6159]], grad_fn=<PowBackward0>)
loss:  0.9568820595741272
loss:  0.6070652604103088
loss:  0.6676913499832153
loss:  0.7386353015899658
----------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.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.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6835-0.6104j, 0.2972+0.2681j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.6004+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6966-0.j, -0.7175-0.j],
        [ 0.7175+0.j,  0.6966-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6835-0.6104j, 0.2972+0.2681j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2629-0.6176j, 0.6974-0.2512j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4505, 0.5495]], grad_fn=<PowBackward0>)
loss:  0.7973996996879578
loss:  0.7971329689025879
loss:  0.35972926020622253
loss:  0.12467411160469055
----------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.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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8084-0.2787j, 0.4849+0.1835j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5990+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6971-0.j, -0.7170-0.j],
        [ 0.7170+0.j,  0.6971-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8084-0.2787j, 0.4849+0.1835j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2159-0.3258j, 0.9176-0.0719j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1528, 0.8472]], grad_fn=<PowBackward0>)
loss:  0.16579170525074005
loss:  0.6032291054725647
loss:  0.436755895614624
loss:  0.3048410415649414
----------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.0341+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.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.5978+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6975-0.j, -0.7166-0.j],
        [ 0.7166+0.j,  0.6975-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.3298-0.5316j,  0.7468+0.2254j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3914, 0.6086]], grad_fn=<PowBackward0>)
loss:  0.496648371219635
loss:  0.611299991607666
loss:  0.6728248596191406
loss:  0.7195882201194763
----------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.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.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6976-0.4072j, 0.5039+0.3060j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5966+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6979-0.j, -0.7162-0.j],
        [ 0.7162+0.j,  0.6979-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6976-0.4072j, 0.5039+0.3060j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1260-0.5033j, 0.8513-0.0781j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2692, 0.7308]], grad_fn=<PowBackward0>)
loss:  0.3135819733142853
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5072357654571533
------------------------------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.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.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6500-0.6748j, 0.2429+0.2512j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5963+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6980-0.j, -0.7161-0.j],
        [ 0.7161+0.j,  0.6980-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6500-0.6748j, 0.2429+0.2512j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2798-0.6509j, 0.6350-0.3079j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5020, 0.4980]], grad_fn=<PowBackward0>)
loss:  0.6891303658485413
loss:  0.7941064238548279
loss:  0.16664890944957733
loss:  0.2558548152446747
----------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.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.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5672-0.3284j, 0.6472+0.3893j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5952+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.5672-0.3284j, 0.6472+0.3893j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0671-0.5080j,  0.8580+0.0369j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2625, 0.7375]], grad_fn=<PowBackward0>)
loss:  0.30454888939857483
loss:  0.30030927062034607
loss:  0.057748764753341675
loss:  0.3591349720954895
----------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.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.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5198-0.1343j, 0.8096+0.2373j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5945+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6987-0.j, -0.7155-0.j],
        [ 0.7155+0.j,  0.6987-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5198-0.1343j, 0.8096+0.2373j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2161-0.2636j,  0.9375+0.0697j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1162, 0.8838]], grad_fn=<PowBackward0>)
loss:  0.12348270416259766
loss:  0.3528236746788025
loss:  0.42994260787963867
loss:  0.7926879525184631
----------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.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.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5262-0.5466j, 0.4523+0.4687j]], 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.5262-0.5466j, 0.4523+0.4687j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0442-0.7173j, 0.6925-0.0634j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5164, 0.4836]], grad_fn=<PowBackward0>)
loss:  0.6607898473739624
loss:  0.46409744024276733
loss:  0.27662894129753113
loss:  0.6711409091949463
----------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.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.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5932+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6991-0.j, -0.7150-0.j],
        [ 0.7150+0.j,  0.6991-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2046-0.6126j, 0.7421-0.1795j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4171, 0.5829]], grad_fn=<PowBackward0>)
loss:  0.8743935227394104
loss:  0.09630697220563889
loss:  0.5377506017684937
loss:  0.8357394933700562
----------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.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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2462-0.2002j, 0.7293+0.6061j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5924+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.2462-0.2002j, 0.7293+0.6061j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3491-0.5732j,  0.6861+0.2808j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4504, 0.5496]], grad_fn=<PowBackward0>)
loss:  0.5986490249633789
loss:  0.2337944060564041
loss:  0.6649910807609558
loss:  0.206187903881073
----------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.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.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4983-0.3779j, 0.6174+0.4771j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5915+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.6997-0.j, -0.7144-0.j],
        [ 0.7144+0.j,  0.6997-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4983-0.3779j, 0.6174+0.4771j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0924-0.6053j,  0.7880+0.0639j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3749, 0.6251]], grad_fn=<PowBackward0>)
loss:  0.46983838081359863
loss:  0.6714330911636353
loss:  0.8491562008857727
loss:  0.17942626774311066
----------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.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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6947-0.5302j, 0.3832+0.2989j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5907+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7001-0.j, -0.7141-0.j],
        [ 0.7141+0.j,  0.7001-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6947-0.5302j, 0.3832+0.2989j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2127-0.5846j, 0.7644-0.1694j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3870, 0.6130]], grad_fn=<PowBackward0>)
loss:  0.949333131313324
loss:  0.31482774019241333
loss:  0.6082348823547363
loss:  0.3040079176425934
----------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.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.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4883-0.5478j, 0.4539+0.5054j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5897+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7004-0.j, -0.7138-0.j],
        [ 0.7138+0.j,  0.7004-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4883-0.5478j, 0.4539+0.5054j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0180-0.7444j, 0.6664-0.0371j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5545, 0.4455]], grad_fn=<PowBackward0>)
loss:  0.5897387862205505
loss:  0.4056164622306824
loss:  0.35851410031318665
loss:  0.8048350811004639
----------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.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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4632-0.3218j, 0.6723+0.4795j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5890+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7006-0.j, -0.7135-0.j],
        [ 0.7135+0.j,  0.7006-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4632-0.3218j, 0.6723+0.4795j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1552-0.5676j,  0.8016+0.1063j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3462, 0.6538]], grad_fn=<PowBackward0>)
loss:  0.4249672591686249
loss:  0.7350586652755737
loss:  0.4797506034374237
loss:  0.4640768766403198
----------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.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.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.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.3283-0.5671j, 0.3894+0.6473j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0476-0.8592j,  0.5071+0.0491j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7405, 0.2595]], grad_fn=<PowBackward0>)
loss:  0.3004966676235199
loss:  0.8712299466133118
loss:  1.240997314453125
loss:  0.7341007590293884
----------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.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.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5975-0.5752j, 0.4019+0.3881j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5876+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7012-0.j, -0.7130-0.j],
        [ 0.7130+0.j,  0.7012-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5975-0.5752j, 0.4019+0.3881j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1323-0.6800j, 0.7078-0.1381j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4799, 0.5201]], grad_fn=<PowBackward0>)
loss:  0.7340919375419617
loss:  0.49037352204322815
loss:  0.37240344285964966
loss:  0.4558693468570709
----------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.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.6120-0.3271j, 0.6351+0.3395j]])
New state:  tensor([[0.6060-0.3161j, 0.6406+0.3500j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5866+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7015-0.j, -0.7127-0.j],
        [ 0.7127+0.j,  0.7015-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6060-0.3161j, 0.6406+0.3500j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0314-0.4711j,  0.8813+0.0203j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2230, 0.7770]], grad_fn=<PowBackward0>)
loss:  0.25227081775665283
loss:  0.46274426579475403
loss:  0.4318670630455017
loss:  0.4318068325519562
----------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.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.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6834-0.2762j, 0.6202+0.2684j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5857+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7018-0.j, -0.7124-0.j],
        [ 0.7124+0.j,  0.7018-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.2762j, 0.6202+0.2684j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0378-0.3851j, 0.9221-0.0084j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1497, 0.8503]], grad_fn=<PowBackward0>)
loss:  0.1621886044740677
loss:  0.6734559535980225
loss:  0.43230128288269043
loss:  0.7075876593589783
----------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.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.7935-0.6086j, 0.0000+0.0000j]])
New state:  tensor([[0.7934-0.6085j, 0.0105+0.0137j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5849+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7021-0.j, -0.7121-0.j],
        [ 0.7121+0.j,  0.7021-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7934-0.6085j, 0.0105+0.0137j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.5495-0.4370j, 0.5723-0.4237j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4930, 0.5070]], grad_fn=<PowBackward0>)
loss:  0.7073395252227783
loss:  0.5929853320121765
loss:  0.2279731035232544
loss:  0.4169919788837433
----------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.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.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5030-0.6598j, 0.3427+0.4407j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5838+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.5030-0.6598j, 0.3427+0.4407j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1094-0.7771j, 0.5987-0.1600j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6159, 0.3841]], grad_fn=<PowBackward0>)
loss:  0.4846392571926117
loss:  0.8092259764671326
loss:  0.7757629752159119
loss:  0.5968630909919739
----------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.0345+0.j]], grad_fn=<ToCopyBackward0>)
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0173j],
        [0.0000+0.0173j, 0.9999+0.0000j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4745-0.6231j, 0.3812+0.4912j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5827+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7029-0.j, -0.7113-0.j],
        [ 0.7113+0.j,  0.7029-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4745-0.6231j, 0.3812+0.4912j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0624-0.7874j, 0.6054-0.0980j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6238, 0.3762]], grad_fn=<PowBackward0>)
loss:  0.47187113761901855
loss:  0.671638548374176
loss:  0.9575850367546082
loss:  0.6003007292747498
----------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.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.1481-0.1228j, 0.7554+0.6264j]])
New state:  tensor([[0.1373-0.1097j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5816+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7033-0.j, -0.7109-0.j],
        [ 0.7109+0.j,  0.7033-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.1373-0.1097j, 0.7574+0.6288j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.4419-0.5242j,  0.6303+0.3642j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4701, 0.5299]], grad_fn=<PowBackward0>)
loss:  0.6350799798965454
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.5025400519371033
------------------------------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.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.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.5813+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.4750-0.1556j, 0.8143+0.2952j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2447-0.3193j,  0.9104+0.0970j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1618, 0.8382]], grad_fn=<PowBackward0>)
loss:  0.17650490999221802
loss:  0.3575644791126251
loss:  0.3030993938446045
loss:  0.35751873254776
----------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.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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2461-0.2001j, 0.7294+0.6061j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5805+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7037-0.j, -0.7105-0.j],
        [ 0.7105+0.j,  0.7037-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2461-0.2001j, 0.7294+0.6061j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3451-0.5715j,  0.6881+0.2843j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4457, 0.5543]], grad_fn=<PowBackward0>)
loss:  0.5900170803070068
loss:  0.25197890400886536
loss:  0.4301052391529083
loss:  0.633606493473053
----------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.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.5443-0.6086j, 0.3849+0.4303j]])
New state:  tensor([[0.5368-0.6018j, 0.3954+0.4397j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5798+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.5368-0.6018j, 0.3954+0.4397j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0970-0.7360j, 0.6596-0.1179j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5510, 0.4490]], grad_fn=<PowBackward0>)
loss:  0.5959661602973938
loss:  0.3170452117919922
loss:  0.7017806172370911
loss:  0.06162535026669502
----------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.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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6947-0.5301j, 0.3833+0.2990j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5790+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7042-0.j, -0.7100-0.j],
        [ 0.7100+0.j,  0.7042-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6947-0.5301j, 0.3833+0.2990j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2170-0.5856j, 0.7632-0.1658j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3900, 0.6100]], grad_fn=<PowBackward0>)
loss:  0.9414895176887512
loss:  0.4301052391529083
loss:  0.7995476126670837
loss:  1.2273122072219849
----------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.5783+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7045-0.j, -0.7097-0.j],
        [ 0.7097+0.j,  0.7045-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.0494-0.7178j, 0.6921-0.0576j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5176, 0.4824]], grad_fn=<PowBackward0>)
loss:  0.6584860682487488
loss:  0.48486921191215515
loss:  0.11937376856803894
loss:  0.2733285129070282
----------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.5774+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7048-0.j, -0.7094-0.j],
        [ 0.7094+0.j,  0.7048-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.0416-0.3851j, 0.9219-0.0066j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1500, 0.8500]], grad_fn=<PowBackward0>)
loss:  0.1625763326883316
loss:  0.3027419149875641
loss:  0.5279409885406494
loss:  0.45129629969596863
----------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.0175j],
        [0.0000+0.0175j, 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.5767+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7050-0.j, -0.7092-0.j],
        [ 0.7092+0.j,  0.7050-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.1469-0.5977j,  0.7797+0.1148j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3789, 0.6211]], grad_fn=<PowBackward0>)
loss:  0.47620683908462524
loss:  0.6637074947357178
loss:  0.46552208065986633
loss:  0.6638787388801575
----------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.0174j],
        [0.0000+0.0174j, 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.5760+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7053-0.j, -0.7090-0.j],
        [ 0.7090+0.j,  0.7053-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.2108-0.6142j, 0.7403-0.1740j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4216, 0.5784]], grad_fn=<PowBackward0>)
loss:  0.863613486289978
loss:  0.42067381739616394
loss:  0.8327987194061279
loss:  0.8208736777305603
----------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.0174j],
        [0.0000+0.0174j, 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.5752+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7055-0.j, -0.7087-0.j],
        [ 0.7087+0.j,  0.7055-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.0407-0.4305j, 0.9016-0.0092j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1870, 0.8130]], grad_fn=<PowBackward0>)
loss:  0.20696526765823364
loss:  0.30171999335289
loss:  0.5978712439537048
loss:  0.2379593700170517
----------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.5167j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5745+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7058-0.j, -0.7084-0.j],
        [ 0.7084+0.j,  0.7058-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6774-0.5167j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1855-0.5926j, 0.7715-0.1389j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3856, 0.6144]], grad_fn=<PowBackward0>)
loss:  0.9530726075172424
loss:  0.7277863025665283
loss:  0.4207950234413147
loss:  0.6963289976119995
----------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.0175j],
        [0.0000+0.0175j, 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.5738+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7061-0.j, -0.7082-0.j],
        [ 0.7082+0.j,  0.7061-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.2601-0.3728j, 0.8854-0.0968j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2066, 0.7934]], grad_fn=<PowBackward0>)
loss:  0.2314869910478592
loss:  0.462924063205719
loss:  0.17261752486228943
loss:  0.42812976241111755
----------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.0175j],
        [0.0000+0.0175j, 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.6833-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5732+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7062-0.j, -0.7080-0.j],
        [ 0.7080+0.j,  0.7062-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6833-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2719-0.6211j, 0.6940-0.2423j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4597, 0.5403]], grad_fn=<PowBackward0>)
loss:  0.7771689891815186
loss:  0.7985104918479919
loss:  0.7283721566200256
loss:  0.3003200590610504
----------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.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.5105-0.6656j, 0.3313+0.4319j]])
New state:  tensor([[0.5029-0.6597j, 0.3428+0.4408j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5726+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7065-0.j, -0.7077-0.j],
        [ 0.7077+0.j,  0.7065-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5029-0.6597j, 0.3428+0.4408j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1126-0.7781j, 0.5981-0.1555j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6181, 0.3819]], grad_fn=<PowBackward0>)
loss:  0.4811815023422241
loss:  0.09305763989686966
loss:  0.414368212223053
loss:  0.6592007279396057
----------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.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.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6833-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5719+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.6833-0.6102j, 0.2976+0.2686j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2724-0.6213j, 0.6938-0.2419j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4601, 0.5399]], grad_fn=<PowBackward0>)
loss:  0.7762297987937927
loss:  0.25361716747283936
loss:  0.5836344957351685
loss:  0.46630486845970154
----------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.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.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5751-0.3671j, 0.6106+0.4021j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5713+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7069-0.j, -0.7073-0.j],
        [ 0.7073+0.j,  0.7069-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5751-0.3671j, 0.6106+0.4021j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0252-0.5439j,  0.8384+0.0246j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2965, 0.7035]], grad_fn=<PowBackward0>)
loss:  0.35162025690078735
loss:  0.7296761870384216
loss:  0.5884193778038025
loss:  0.469696968793869
----------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.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.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.5707+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.5809-0.4058j, 0.5737+0.4108j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0051-0.5774j, 0.8164+0.0036j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3334, 0.6666]], grad_fn=<PowBackward0>)
loss:  0.40563657879829407
loss:  0.6001332998275757
loss:  0.6698876619338989
loss:  0.8600543141365051
----------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.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.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6208-0.6447j, 0.3099+0.3208j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5701+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7073-0.j, -0.7069-0.j],
        [ 0.7069+0.j,  0.7073-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6208-0.6447j, 0.3099+0.3208j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2201-0.6828j, 0.6581-0.2288j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5146, 0.4854]], grad_fn=<PowBackward0>)
loss:  0.6643979549407959
loss:  0.664294421672821
loss:  0.4627675414085388
loss:  0.3677807152271271
----------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.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.7027-0.6285j, 0.2485+0.2222j]])
New state:  tensor([[0.6987-0.6241j, 0.2594+0.2345j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5694+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7076-0.j, -0.7066-0.j],
        [ 0.7066+0.j,  0.7076-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6987-0.6241j, 0.2594+0.2345j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3111-0.6073j, 0.6773-0.2751j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4656, 0.5344]], grad_fn=<PowBackward0>)
loss:  0.7644462585449219
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49881112575531006
------------------------------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.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.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6135-0.5907j, 0.3770+0.3641j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5693+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7077-0.j, -0.7066-0.j],
        [ 0.7066+0.j,  0.7077-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6135-0.5907j, 0.3770+0.3641j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1677-0.6753j, 0.7003-0.1597j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4841, 0.5159]], grad_fn=<PowBackward0>)
loss:  0.7254306674003601
loss:  0.5230528116226196
loss:  0.35621917247772217
loss:  0.4056430160999298
----------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.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.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.5687+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7078-0.j, -0.7064-0.j],
        [ 0.7064+0.j,  0.7078-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.1438-0.5973j,  0.7803+0.1172j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3774, 0.6226]], grad_fn=<PowBackward0>)
loss:  0.47386622428894043
loss:  0.06431983411312103
loss:  0.3193414509296417
loss:  0.7944355010986328
----------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.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.3666-0.3533j, 0.6197+0.5972j]])
New state:  tensor([[0.3562-0.3424j, 0.6258+0.6035j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5684+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7080-0.j, -0.7062-0.j],
        [ 0.7062+0.j,  0.7080-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3562-0.3424j, 0.6258+0.6035j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1898-0.6687j,  0.6946+0.1854j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4831, 0.5169]], grad_fn=<PowBackward0>)
loss:  0.6599979996681213
loss:  0.42666321992874146
loss:  0.20732653141021729
loss:  0.1725459098815918
----------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.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.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7219-0.5972j, 0.2671+0.2254j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5680+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7081-0.j, -0.7061-0.j],
        [ 0.7061+0.j,  0.7081-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7219-0.5972j, 0.2671+0.2254j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3226-0.5820j, 0.6989-0.2621j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4429, 0.5571]], grad_fn=<PowBackward0>)
loss:  0.8145098090171814
loss:  0.47976601123809814
loss:  0.46567028760910034
loss:  0.4133685231208801
----------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.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.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.5676+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7082-0.j, -0.7060-0.j],
        [ 0.7060+0.j,  0.7082-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.1009-0.7367j, 0.6590-0.1134j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5529, 0.4471]], grad_fn=<PowBackward0>)
loss:  0.5926527976989746
loss:  0.7729540467262268
loss:  0.8582348823547363
loss:  0.6568840742111206
----------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.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.5879-0.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5817-0.3027j, 0.6627+0.3616j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5671+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7084-0.j, -0.7058-0.j],
        [ 0.7058+0.j,  0.7084-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5817-0.3027j, 0.6627+0.3616j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0557-0.4697j,  0.8801+0.0425j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2237, 0.7763]], grad_fn=<PowBackward0>)
loss:  0.2532021701335907
loss:  1.2110501527786255
loss:  0.6221296191215515
loss:  0.27114138007164
----------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.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.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5751-0.3671j, 0.6106+0.4021j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5666+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7086-0.j, -0.7056-0.j],
        [ 0.7056+0.j,  0.7086-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5751-0.3671j, 0.6106+0.4021j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0233-0.5438j,  0.8385+0.0259j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2963, 0.7037]], grad_fn=<PowBackward0>)
loss:  0.3513934016227722
loss:  0.7620282173156738
loss:  0.46673595905303955
loss:  0.4464092254638672
----------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.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.5856-0.1656j, 0.7635+0.2160j]])
New state:  tensor([[0.5817-0.1523j, 0.7663+0.2262j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5661+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7088-0.j, -0.7054-0.j],
        [ 0.7054+0.j,  0.7088-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5817-0.1523j, 0.7663+0.2262j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1282-0.2675j,  0.9535+0.0529j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0880, 0.9120]], grad_fn=<PowBackward0>)
loss:  0.09209953993558884
loss:  0.4259888529777527
loss:  0.23417852818965912
loss:  0.25134819746017456
----------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.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.5656+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7089-0.j, -0.7053-0.j],
        [ 0.7053+0.j,  0.7089-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.1889-0.5932j, 0.7706-0.1363j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3876, 0.6124]], grad_fn=<PowBackward0>)
loss:  0.9478958249092102
loss:  0.3026283383369446
loss:  0.3666897416114807
loss:  0.4624619781970978
----------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.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.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4359-0.3023j, 0.6903+0.4920j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5653+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7091-0.j, -0.7051-0.j],
        [ 0.7051+0.j,  0.7091-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4359-0.3023j, 0.6903+0.4920j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1777-0.5613j,  0.7969+0.1357j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3466, 0.6534]], grad_fn=<PowBackward0>)
loss:  0.4255436956882477
loss:  0.4686747193336487
loss:  0.7253463864326477
loss:  0.46278345584869385
----------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.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.6197-0.3666j, 0.5972+0.3533j]])
New state:  tensor([[0.6135-0.3562j, 0.6035+0.3641j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5649+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7092-0.j, -0.7050-0.j],
        [ 0.7050+0.j,  0.7092-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6135-0.3562j, 0.6035+0.3641j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0096-0.5093j, 0.8605+0.0071j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2594, 0.7406]], grad_fn=<PowBackward0>)
loss:  0.30035853385925293
loss:  0.30155786871910095
loss:  0.4770815074443817
loss:  0.5787057876586914
----------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.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.4969-0.5556j, 0.4444+0.4969j]])
New state:  tensor([[0.4882-0.5477j, 0.4541+0.5055j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5646+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7093-0.j, -0.7049-0.j],
        [ 0.7049+0.j,  0.7093-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4882-0.5477j, 0.4541+0.5055j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0261-0.7448j, 0.6662-0.0275j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5554, 0.4446]], grad_fn=<PowBackward0>)
loss:  0.5879827737808228
loss:  0.1632297784090042
loss:  0.6868347525596619
loss:  0.8563523888587952
----------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.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.4223-0.4382j, 0.5506+0.5714j]])
New state:  tensor([[0.4122-0.4285j, 0.5582+0.5787j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5642+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7094-0.j, -0.7048-0.j],
        [ 0.7048+0.j,  0.7094-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4122-0.4285j, 0.5582+0.5787j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1009-0.7119j,  0.6865+0.1085j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5169, 0.4831]], grad_fn=<PowBackward0>)
loss:  0.7275844812393188
loss:  0.6652267575263977
loss:  0.5781950354576111
loss:  0.5941427946090698
----------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.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.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4096-0.6396j, 0.3587+0.5427j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5637+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7096-0.j, -0.7046-0.j],
        [ 0.7046+0.j,  0.7096-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4096-0.6396j, 0.3587+0.5427j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0379-0.8362j, 0.5431-0.0656j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7007, 0.2993]], grad_fn=<PowBackward0>)
loss:  0.35564935207366943
loss:  0.685987651348114
loss:  0.4145297110080719
loss:  0.2407161146402359
----------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.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.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6208-0.6447j, 0.3099+0.3208j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5632+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.6208-0.6447j, 0.3099+0.3208j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2224-0.6835j, 0.6573-0.2264j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5167, 0.4833]], grad_fn=<PowBackward0>)
loss:  0.6603373289108276
loss:  0.8196544051170349
loss:  0.657763659954071
loss:  0.7880933284759521
----------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.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.8114-0.2869j, 0.4801+0.1697j]])
New state:  tensor([[0.8084-0.2785j, 0.4850+0.1839j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5626+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7100-0.j, -0.7042-0.j],
        [ 0.7042+0.j,  0.7100-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8084-0.2785j, 0.4850+0.1839j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2324-0.3272j, 0.9136-0.0655j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1611, 0.8389]], grad_fn=<PowBackward0>)
loss:  0.1756218820810318
loss:  0.6564033627510071
loss:  0.9302382469177246
loss:  0.6597325205802917
----------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.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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4631-0.3217j, 0.6724+0.4796j]], 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.4631-0.3217j, 0.6724+0.4796j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1444-0.5660j,  0.8036+0.1141j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3413, 0.6587]], grad_fn=<PowBackward0>)
loss:  0.4174407720565796
loss:  0.5965535044670105
loss:  0.3012634515762329
loss:  0.7686036229133606
----------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.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.5238-0.1481j, 0.8072+0.2283j]])
New state:  tensor([[0.5197-0.1341j, 0.8097+0.2374j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5614+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7104-0.j, -0.7038-0.j],
        [ 0.7038+0.j,  0.7104-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5197-0.1341j, 0.8097+0.2374j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2006-0.2623j,  0.9410+0.0743j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1091, 0.8909]], grad_fn=<PowBackward0>)
loss:  0.11547376960515976
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49637338519096375
------------------------------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.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.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5907-0.6135j, 0.3640+0.3770j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5613+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.5907-0.6135j, 0.3640+0.3770j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1635-0.7012j, 0.6744-0.1639j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5184, 0.4816]], grad_fn=<PowBackward0>)
loss:  0.6570611000061035
loss:  0.46280041337013245
loss:  0.6564239859580994
loss:  0.4133438169956207
----------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.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.3143j, 0.6573+0.3514j]])
New state:  tensor([[0.5817-0.3028j, 0.6627+0.3615j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5610+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7106-0.j, -0.7036-0.j],
        [ 0.7036+0.j,  0.7106-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5817-0.3028j, 0.6627+0.3615j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0529-0.4695j,  0.8802+0.0439j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2233, 0.7767]], grad_fn=<PowBackward0>)
loss:  0.252660870552063
loss:  0.5877279043197632
loss:  0.3003876507282257
loss:  0.36547914147377014
----------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.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.6197-0.5972j, 0.3666+0.3533j]])
New state:  tensor([[0.6135-0.5907j, 0.3770+0.3640j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5607+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7107-0.j, -0.7035-0.j],
        [ 0.7035+0.j,  0.7107-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6135-0.5907j, 0.3770+0.3640j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1708-0.6759j, 0.6995-0.1569j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4860, 0.5140]], grad_fn=<PowBackward0>)
loss:  0.7214588522911072
loss:  0.4118327498435974
loss:  0.6829962134361267
loss:  0.3210381865501404
----------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.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.5604+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7108-0.j, -0.7034-0.j],
        [ 0.7034+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.1163-0.7790j, 0.5974-0.1508j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6203, 0.3797]], grad_fn=<PowBackward0>)
loss:  0.47751179337501526
loss:  0.5906996726989746
loss:  0.4744718372821808
loss:  0.4437248110771179
----------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.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.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5752-0.3671j, 0.6105+0.4020j]], 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.5752-0.3671j, 0.6105+0.4020j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0206-0.5437j,  0.8385+0.0276j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2961, 0.7039]], grad_fn=<PowBackward0>)
loss:  0.351094126701355
loss:  0.17630894482135773
loss:  0.6161812543869019
loss:  0.2077706903219223
----------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.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.5738-0.3395j, 0.6415+0.3795j]])
New state:  tensor([[0.5671-0.3282j, 0.6473+0.3895j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5599+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7109-0.j, -0.7033-0.j],
        [ 0.7033+0.j,  0.7109-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5671-0.3282j, 0.6473+0.3895j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0521-0.5072j,  0.8590+0.0460j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2600, 0.7400]], grad_fn=<PowBackward0>)
loss:  0.3011014461517334
loss:  0.23619510233402252
loss:  0.9286006689071655
loss:  0.6822227835655212
----------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.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.6041-0.5821j, 0.3920+0.3777j]])
New state:  tensor([[0.5974-0.5752j, 0.4020+0.3882j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5597+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7110-0.j, -0.7032-0.j],
        [ 0.7032+0.j,  0.7110-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5974-0.5752j, 0.4020+0.3882j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1420-0.6819j, 0.7059-0.1285j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4852, 0.5148]], grad_fn=<PowBackward0>)
loss:  0.7232682108879089
loss:  0.7672138810157776
loss:  0.17004825174808502
loss:  0.5750165581703186
----------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.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.6542-0.6789j, 0.2313+0.2400j]])
New state:  tensor([[0.6499-0.6748j, 0.2431+0.2514j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5594+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7111-0.j, -0.7031-0.j],
        [ 0.7031+0.j,  0.7111-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6499-0.6748j, 0.2431+0.2514j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2913-0.6566j, 0.6298-0.2957j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5159, 0.4841]], grad_fn=<PowBackward0>)
loss:  0.6617931127548218
loss:  0.7899028658866882
loss:  0.7260788083076477
loss:  0.16352201998233795
----------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.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.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6774-0.5167j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5591+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.6774-0.5167j, 0.4131+0.3217j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1914-0.5936j, 0.7700-0.1344j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3890, 0.6110]], grad_fn=<PowBackward0>)
loss:  0.9440941214561462
loss:  0.4676313102245331
loss:  0.42399314045906067
loss:  0.8529618382453918
----------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.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.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4982-0.3778j, 0.6175+0.4772j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5588+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7113-0.j, -0.7029-0.j],
        [ 0.7029+0.j,  0.7113-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4982-0.3778j, 0.6175+0.4772j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0796-0.6041j,  0.7894+0.0740j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3713, 0.6287]], grad_fn=<PowBackward0>)
loss:  0.4641261696815491
loss:  0.7558025121688843
loss:  0.35510748624801636
loss:  0.2510690689086914
----------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.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.7258-0.6018j, 0.2566+0.2128j]])
New state:  tensor([[0.7220-0.5972j, 0.2670+0.2254j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5585+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7114-0.j, -0.7028-0.j],
        [ 0.7028+0.j,  0.7114-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7220-0.5972j, 0.2670+0.2254j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.3260-0.5833j, 0.6973-0.2594j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4464, 0.5536]], grad_fn=<PowBackward0>)
loss:  0.8064492344856262
loss:  0.6575837135314941
loss:  0.269487589597702
loss:  0.35506734251976013
----------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.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.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5521-0.6189j, 0.3737+0.4154j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5582+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7115-0.j, -0.7026-0.j],
        [ 0.7026+0.j,  0.7115-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5521-0.6189j, 0.3737+0.4154j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1303-0.7322j, 0.6538-0.1393j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5531, 0.4469]], grad_fn=<PowBackward0>)
loss:  0.5922300815582275
loss:  0.3033539056777954
loss:  0.4231632351875305
loss:  0.6551282405853271
----------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.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.9072-0.3208j, 0.2566+0.0907j]])
New state:  tensor([[0.9055-0.3162j, 0.2621+0.1065j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5580+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7116-0.j, -0.7026-0.j],
        [ 0.7026+0.j,  0.7116-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.9055-0.3162j, 0.2621+0.1065j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4602-0.2998j, 0.8227-0.1464j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3017, 0.6983]], grad_fn=<PowBackward0>)
loss:  1.198286533355713
loss:  0.5738542675971985
loss:  0.7658379077911377
loss:  0.24210485816001892
----------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.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.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.5576+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.5261-0.5466j, 0.4524+0.4688j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0566-0.7183j, 0.6916-0.0502j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5192, 0.4808]], grad_fn=<PowBackward0>)
loss:  0.6554821133613586
loss:  0.5159878134727478
loss:  0.06722869724035263
loss:  0.0908234491944313
----------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.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.8012-0.5666j, 0.1571+0.1111j]])
New state:  tensor([[0.7992-0.5638j, 0.1669+0.1250j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5573+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7119-0.j, -0.7023-0.j],
        [ 0.7023+0.j,  0.7119-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7992-0.5638j, 0.1669+0.1250j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.4517-0.4891j, 0.6801-0.3070j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4432, 0.5568]], grad_fn=<PowBackward0>)
loss:  0.8137321472167969
loss:  0.4705262780189514
loss:  0.3008495271205902
loss:  0.40570488572120667
----------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.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.4829-0.6296j, 0.3704+0.4829j]])
New state:  tensor([[0.4745-0.6231j, 0.3812+0.4912j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5570+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7120-0.j, -0.7022-0.j],
        [ 0.7022+0.j,  0.7120-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4745-0.6231j, 0.3812+0.4912j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0701-0.7886j, 0.6046-0.0879j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6267, 0.3733]], grad_fn=<PowBackward0>)
loss:  0.4672163128852844
loss:  0.11444162577390671
loss:  0.4160563349723816
loss:  0.7822004556655884
----------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.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.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4766-0.6794j, 0.3261+0.4528j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5568+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7120-0.j, -0.7021-0.j],
        [ 0.7021+0.j,  0.7120-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4766-0.6794j, 0.3261+0.4528j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1104-0.8017j, 0.5668-0.1546j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6548, 0.3452]], grad_fn=<PowBackward0>)
loss:  0.4233734607696533
loss:  0.6565778255462646
loss:  0.4619946777820587
loss:  0.8515242338180542
----------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.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.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5671-0.6355j, 0.3505+0.3894j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5565+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7121-0.j, -0.7020-0.j],
        [ 0.7020+0.j,  0.7121-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5671-0.6355j, 0.3505+0.3894j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1578-0.7260j, 0.6477-0.1689j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5519, 0.4481]], grad_fn=<PowBackward0>)
loss:  0.5943710803985596
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.4948979318141937
------------------------------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.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.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3760-0.2597j, 0.7247+0.5158j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5564+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7122-0.j, -0.7020-0.j],
        [ 0.7020+0.j,  0.7122-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3760-0.2597j, 0.7247+0.5158j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2409-0.5470j,  0.7801+0.1850j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3573, 0.6427]], grad_fn=<PowBackward0>)
loss:  0.44200217723846436
loss:  0.250987708568573
loss:  0.5943125486373901
loss:  0.42258232831954956
----------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.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.3610-0.2342j, 0.7572+0.4914j]])
New state:  tensor([[0.3524-0.2211j, 0.7612+0.4975j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5563+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7122-0.j, -0.7020-0.j],
        [ 0.7020+0.j,  0.7122-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3524-0.2211j, 0.7612+0.4975j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2833-0.5067j,  0.7895+0.1991j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3370, 0.6630]], grad_fn=<PowBackward0>)
loss:  0.41101160645484924
loss:  0.6128838062286377
loss:  0.46282872557640076
loss:  0.6548464298248291
----------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.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.2566-0.2128j, 0.7258+0.6018j]])
New state:  tensor([[0.2461-0.2002j, 0.7293+0.6061j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5562+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7123-0.j, -0.7019-0.j],
        [ 0.7019+0.j,  0.7123-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.2461-0.2002j, 0.7293+0.6061j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.3366-0.5680j,  0.6923+0.2912j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4360, 0.5640]], grad_fn=<PowBackward0>)
loss:  0.5726323127746582
loss:  0.5895447134971619
loss:  0.26903730630874634
loss:  0.09062732756137848
----------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.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.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.5560+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7123-0.j, -0.7019-0.j],
        [ 0.7019+0.j,  0.7123-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.2780-0.6231j, 0.6916-0.2371j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4656, 0.5344]], grad_fn=<PowBackward0>)
loss:  0.7645338177680969
loss:  0.7535653114318848
loss:  0.06763263791799545
loss:  0.3007335960865021
----------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.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.4714-0.3333j, 0.6667+0.4714j]])
New state:  tensor([[0.4632-0.3218j, 0.6723+0.4795j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5559+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7124-0.j, -0.7018-0.j],
        [ 0.7018+0.j,  0.7124-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4632-0.3218j, 0.6723+0.4795j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1419-0.5657j,  0.8040+0.1158j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3402, 0.6598]], grad_fn=<PowBackward0>)
loss:  0.41576820611953735
loss:  0.20800909399986267
loss:  0.42309215664863586
loss:  1.195229172706604
----------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.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.5666-0.5879j, 0.4006+0.4157j]])
New state:  tensor([[0.5593-0.5809j, 0.4107+0.4255j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5557+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7124-0.j, -0.7018-0.j],
        [ 0.7018+0.j,  0.7124-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5593-0.5809j, 0.4107+0.4255j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1102-0.7124j, 0.6851-0.1046j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5197, 0.4803]], grad_fn=<PowBackward0>)
loss:  0.654466986656189
loss:  0.8040549159049988
loss:  0.468051552772522
loss:  0.7809657454490662
----------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.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.6829-0.5238j, 0.4040+0.3099j]])
New state:  tensor([[0.6775-0.5167j, 0.4130+0.3216j]], 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.6775-0.5167j, 0.4130+0.3216j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1928-0.5938j, 0.7696-0.1334j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3898, 0.6102]], grad_fn=<PowBackward0>)
loss:  0.942034900188446
loss:  0.23768998682498932
loss:  0.47168225049972534
loss:  0.5147372484207153
----------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.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.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.5554+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.5974-0.5752j, 0.4020+0.3881j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1436-0.6822j, 0.7056-0.1271j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4860, 0.5140]], grad_fn=<PowBackward0>)
loss:  0.7216002345085144
loss:  0.6588344573974609
loss:  0.4669152498245239
loss:  0.9255595207214355
----------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.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.6539+0.5047j]], 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.4495-0.3401j, 0.6539+0.5047j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1385-0.5965j,  0.7813+0.1210j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3750, 0.6250]], grad_fn=<PowBackward0>)
loss:  0.46995651721954346
loss:  0.25217363238334656
loss:  0.7189026474952698
loss:  0.30066820979118347
----------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.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.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.5551+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7126-0.j, -0.7015-0.j],
        [ 0.7015+0.j,  0.7126-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.1851-0.6675j,  0.6959+0.1897j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4798, 0.5202]], grad_fn=<PowBackward0>)
loss:  0.6534769535064697
loss:  0.30365827679634094
loss:  0.6775497794151306
loss:  0.4634828269481659
----------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.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.7027-0.4157j, 0.4969+0.2940j]])
New state:  tensor([[0.6975-0.4071j, 0.5040+0.3061j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5550+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7127-0.j, -0.7015-0.j],
        [ 0.7015+0.j,  0.7127-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6975-0.4071j, 0.5040+0.3061j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1436-0.5048j, 0.8485-0.0675j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2755, 0.7245]], grad_fn=<PowBackward0>)
loss:  0.3222215175628662
loss:  0.3508621156215668
loss:  0.16869403421878815
loss:  0.30044126510620117
----------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.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.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4889-0.3401j, 0.6539+0.4666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5549+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7127-0.j, -0.7015-0.j],
        [ 0.7015+0.j,  0.7127-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4889-0.3401j, 0.6539+0.4666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1102-0.5697j,  0.8090+0.0940j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3367, 0.6633]], grad_fn=<PowBackward0>)
loss:  0.41059011220932007
loss:  0.6554964780807495
loss:  0.47582104802131653
loss:  0.724731981754303
----------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.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.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.5548+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7127-0.j, -0.7014-0.j],
        [ 0.7014+0.j,  0.7127-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.2188-0.6159j, 0.7380-0.1676j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4272, 0.5728]], grad_fn=<PowBackward0>)
loss:  0.8504083752632141
loss:  0.8110716342926025
loss:  0.40572279691696167
loss:  0.35468316078186035
----------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.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.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4766-0.6794j, 0.3261+0.4527j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5547+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7128-0.j, -0.7014-0.j],
        [ 0.7014+0.j,  0.7128-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4766-0.6794j, 0.3261+0.4527j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1110-0.8018j, 0.5667-0.1538j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.6552, 0.3448]], grad_fn=<PowBackward0>)
loss:  0.4227622449398041
loss:  0.17785707116127014
loss:  0.5715333819389343
loss:  0.7875135540962219
----------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.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.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6209-0.6447j, 0.3098+0.3206j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5545+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7128-0.j, -0.7013-0.j],
        [ 0.7013+0.j,  0.7128-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6209-0.6447j, 0.3098+0.3206j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2253-0.6845j, 0.6563-0.2236j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5193, 0.4807]], grad_fn=<PowBackward0>)
loss:  0.6553080081939697
loss:  0.5872910618782043
loss:  0.6550240516662598
loss:  0.6769394874572754
----------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.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.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6834-0.2762j, 0.6202+0.2684j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5544+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.6834-0.2762j, 0.6202+0.2684j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0523-0.3852j, 0.9214-0.0024j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1511, 0.8489]], grad_fn=<PowBackward0>)
loss:  0.1637951135635376
loss:  0.5909267067909241
loss:  0.46187493205070496
loss:  0.1138266921043396
----------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.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.7572-0.3610j, 0.4914+0.2342j]])
New state:  tensor([[0.7531-0.3525j, 0.4975+0.2473j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5543+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7129-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7129-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.7531-0.3525j, 0.4975+0.2473j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1880-0.4247j, 0.8828-0.0709j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2157, 0.7843]], grad_fn=<PowBackward0>)
loss:  0.24295513331890106
loss:  0.8500904440879822
loss:  0.35463660955429077
loss:  0.36379387974739075
----------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.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.6879-0.6153j, 0.2869+0.2566j]])
New state:  tensor([[0.6834-0.6103j, 0.2975+0.2684j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5542+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6834-0.6103j, 0.2975+0.2684j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2787-0.6233j, 0.6913-0.2366j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4662, 0.5338]], grad_fn=<PowBackward0>)
loss:  0.7632073163986206
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49421241879463196
------------------------------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.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.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.5542+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-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.1439-0.5049j, 0.8485-0.0673j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2756, 0.7244]], grad_fn=<PowBackward0>)
loss:  0.32240015268325806
loss:  0.6530001759529114
loss:  0.6579235196113586
loss:  0.23817528784275055
----------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.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.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5640-0.4287j, 0.5581+0.4321j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5541+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5640-0.4287j, 0.5581+0.4321j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0108-0.6086j, 0.7934+0.0075j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3705, 0.6295]], grad_fn=<PowBackward0>)
loss:  0.4628429114818573
loss:  0.571207582950592
loss:  1.1929165124893188
loss:  0.3546231687068939
----------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.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.5065-0.3884j, 0.6108+0.4685j]])
New state:  tensor([[0.4983-0.3779j, 0.6174+0.4771j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5541+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4983-0.3779j, 0.6174+0.4771j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0776-0.6040j,  0.7896+0.0752j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3708, 0.6292]], grad_fn=<PowBackward0>)
loss:  0.4633270800113678
loss:  0.41528910398483276
loss:  0.6765930652618408
loss:  0.40993016958236694
----------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.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.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5541+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2191-0.6160j, 0.7379-0.1674j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4274, 0.5726]], grad_fn=<PowBackward0>)
loss:  0.8499688506126404
loss:  0.8103631734848022
loss:  0.6539767384529114
loss:  0.4755818545818329
----------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.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.5506-0.4223j, 0.5714+0.4382j]])
New state:  tensor([[0.5430-0.4124j, 0.5786+0.4477j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5540+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7012-0.j],
        [ 0.7012+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5430-0.4124j, 0.5786+0.4477j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.0185-0.6079j,  0.7932+0.0300j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3699, 0.6301]], grad_fn=<PowBackward0>)
loss:  0.46185827255249023
loss:  0.5711274743080139
loss:  0.09033461660146713
loss:  0.3004506826400757
----------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.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.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.5540+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7130-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.0494-0.5071j,  0.8592+0.0474j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.2596, 0.7404]], grad_fn=<PowBackward0>)
loss:  0.3005627393722534
loss:  0.4707961678504944
loss:  0.30056121945381165
loss:  0.3037720024585724
----------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.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.4190-0.6458j, 0.3474+0.5354j]])
New state:  tensor([[0.4097-0.6397j, 0.3585+0.5426j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5540+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4097-0.6397j, 0.3585+0.5426j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0408-0.8365j, 0.5429-0.0616j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.7014, 0.2986]], grad_fn=<PowBackward0>)
loss:  0.35460636019706726
loss:  0.763030469417572
loss:  0.7519341707229614
loss:  0.8498833775520325
----------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.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.6728-0.3208j, 0.6018+0.2869j]])
New state:  tensor([[0.6678-0.3103j, 0.6072+0.2984j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5539+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7130-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7130-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6678-0.3103j, 0.6072+0.2984j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0504-0.4305j, 0.9012-0.0048j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1879, 0.8121]], grad_fn=<PowBackward0>)
loss:  0.20812086760997772
loss:  0.3637169599533081
loss:  0.250897616147995
loss:  0.5933098196983337
----------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.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.4969-0.3514j, 0.6479+0.4581j]])
New state:  tensor([[0.4889-0.3401j, 0.6538+0.4666j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5539+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4889-0.3401j, 0.6538+0.4666j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1098-0.5697j,  0.8090+0.0943j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3366, 0.6634]], grad_fn=<PowBackward0>)
loss:  0.4103776216506958
loss:  0.16839054226875305
loss:  0.7629779577255249
loss:  0.7182851433753967
----------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.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.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5262-0.5466j, 0.4524+0.4688j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5539+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5262-0.5466j, 0.4524+0.4688j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.0580-0.7184j, 0.6915-0.0490j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5195, 0.4805]], grad_fn=<PowBackward0>)
loss:  0.6549347639083862
loss:  0.4225353002548218
loss:  0.6549072265625
loss:  0.7791759371757507
----------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.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.6998-0.5367j, 0.3741+0.2869j]])
New state:  tensor([[0.6947-0.5302j, 0.3833+0.2989j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5538+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6947-0.5302j, 0.3833+0.2989j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2267-0.5876j, 0.7604-0.1586j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3967, 0.6033]], grad_fn=<PowBackward0>)
loss:  0.9245588183403015
loss:  0.9409970045089722
loss:  0.405730664730072
loss:  0.25205299258232117
----------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.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.3849-0.2722j, 0.7201+0.5092j]])
New state:  tensor([[0.3761-0.2597j, 0.7247+0.5157j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5538+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.3761-0.2597j, 0.7247+0.5157j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.2399-0.5468j,  0.7804+0.1857j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3565, 0.6435]], grad_fn=<PowBackward0>)
loss:  0.4408162534236908
loss:  0.4666329324245453
loss:  0.46829020977020264
loss:  0.8024067282676697
----------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.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.8607+0.j, 0.5092+0.j]])
New state:  tensor([[0.8605+0.0088j, 0.5091+0.0148j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5538+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7011-0.j],
        [ 0.7011+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.8605+0.0088j, 0.5091+0.0148j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2567-0.0041j, 0.9663+0.0167j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.0659, 0.9341]], grad_fn=<PowBackward0>)
loss:  0.06821003556251526
loss:  0.4225040376186371
loss:  0.2685804069042206
loss:  0.46951135993003845
----------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.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.6415-0.5738j, 0.3795+0.3395j]])
New state:  tensor([[0.6356-0.5672j, 0.3893+0.3504j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5537+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6356-0.5672j, 0.3893+0.3504j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1803-0.6501j, 0.7232-0.1477j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.4552, 0.5448]], grad_fn=<PowBackward0>)
loss:  0.7870928645133972
loss:  0.24309968948364258
loss:  0.1638360470533371
loss:  0.35080769658088684
----------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.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.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5522-0.6189j, 0.3736+0.4153j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5537+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.5522-0.6189j, 0.3736+0.4153j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.1319-0.7325j, 0.6535-0.1377j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5539, 0.4461]], grad_fn=<PowBackward0>)
loss:  0.5906964540481567
loss:  0.7209234237670898
loss:  0.5872344374656677
loss:  0.7243935465812683
----------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.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.6264-0.6500j, 0.2986+0.3099j]])
New state:  tensor([[0.6209-0.6448j, 0.3098+0.3206j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5537+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.6209-0.6448j, 0.3098+0.3206j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[0.2257-0.6846j, 0.6562-0.2234j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.5195, 0.4805]], grad_fn=<PowBackward0>)
loss:  0.6548090577125549
loss:  0.5888836979866028
loss:  0.6106418371200562
loss:  0.6761656403541565
----------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.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.4444-0.3143j, 0.6849+0.4843j]])
New state:  tensor([[0.4360-0.3024j, 0.6902+0.4919j]], grad_fn=<PermuteBackward0>)
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]], grad_fn=<ToCopyBackward0>)
ry_matrix:  tensor([[ 0.7131-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7131-0.j]], grad_fn=<SqueezeBackward1>)
Performing matrix multiplication

Current state:  tensor([[0.4360-0.3024j, 0.6902+0.4919j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1729-0.5605j,  0.7979+0.1388j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.3441, 0.6559]], grad_fn=<PowBackward0>)
loss:  0.42170077562332153
loss:  0.5136252641677856
loss:  0.17813822627067566
loss:  0.6537318825721741
----------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.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.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.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.5198-0.1342j, 0.8096+0.2373j]], grad_fn=<PermuteBackward0>)
New state:  tensor([[-0.1969-0.2621j,  0.9418+0.0751j]], grad_fn=<PermuteBackward0>)
----------Measure----------
Probability:  tensor([[0.1074, 0.8926]], grad_fn=<PowBackward0>)
loss:  0.11366453766822815
--------------------Validation--------------------
valid set accuracy: 0.8275862336158752
valid set loss: 0.49404269456863403
--------------------Test--------------------
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.6849j, 0.3143+0.4444j]])
New state:  tensor([[0.4766-0.6794j, 0.3260+0.4527j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4766-0.6794j, 0.3260+0.4527j]])
New state:  tensor([[0.1114-0.8019j, 0.5666-0.1534j]])
----------Measure----------
Probability:  tensor([[0.6554, 0.3446]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.3208-0.6728j, 0.2869+0.6018j]])
New state:  tensor([[0.3103-0.6678j, 0.2984+0.6072j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.3103-0.6678j, 0.2984+0.6072j]])
New state:  tensor([[0.0121-0.9019j, 0.4304-0.0351j]])
----------Measure----------
Probability:  tensor([[0.8135, 0.1865]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5666-0.4006j, 0.5879+0.4157j]])
New state:  tensor([[0.5593-0.3904j, 0.5948+0.4254j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5593-0.3904j, 0.5948+0.4254j]])
New state:  tensor([[-0.0180-0.5767j,  0.8162+0.0297j]])
----------Measure----------
Probability:  tensor([[0.3329, 0.6671]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5592-0.6253j, 0.3629+0.4057j]])
New state:  tensor([[0.5522-0.6189j, 0.3736+0.4153j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5522-0.6189j, 0.3736+0.4153j]])
New state:  tensor([[0.1319-0.7325j, 0.6535-0.1377j]])
----------Measure----------
Probability:  tensor([[0.5540, 0.4460]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2283-0.1481j, 0.8072+0.5238j]])
New state:  tensor([[0.2193-0.1342j, 0.8096+0.5276j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2193-0.1342j, 0.8096+0.5276j]])
New state:  tensor([[-0.4112-0.4656j,  0.7311+0.2822j]])
----------Measure----------
Probability:  tensor([[0.3859, 0.6141]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4685-0.6108j, 0.3884+0.5065j]])
New state:  tensor([[0.4597-0.6041j, 0.3989+0.5145j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4597-0.6041j, 0.3989+0.5145j]])
New state:  tensor([[0.0482-0.7914j, 0.6067-0.0565j]])
----------Measure----------
Probability:  tensor([[0.6287, 0.3713]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6949-0.5762j, 0.3313+0.2747j]])
New state:  tensor([[0.6900-0.5704j, 0.3411+0.2866j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6900-0.5704j, 0.3411+0.2866j]])
New state:  tensor([[0.2530-0.6077j, 0.7270-0.1954j]])
----------Measure----------
Probability:  tensor([[0.4333, 0.5667]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2645-0.2029j, 0.7481+0.5738j]])
New state:  tensor([[0.2546-0.1900j, 0.7515+0.5782j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2546-0.1900j, 0.7515+0.5782j]])
New state:  tensor([[-0.3452-0.5408j,  0.7144+0.2792j]])
----------Measure----------
Probability:  tensor([[0.4117, 0.5883]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5493-0.6625j, 0.3250+0.3920j]])
New state:  tensor([[0.5425-0.6568j, 0.3364+0.4014j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5425-0.6568j, 0.3364+0.4014j]])
New state:  tensor([[0.1511-0.7498j, 0.6202-0.1742j]])
----------Measure----------
Probability:  tensor([[0.5850, 0.4150]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5238-0.3099j, 0.6829+0.4040j]])
New state:  tensor([[0.5167-0.2981j, 0.6882+0.4130j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5167-0.2981j, 0.6882+0.4130j]])
New state:  tensor([[-0.1139-0.5021j,  0.8530+0.0856j]])
----------Measure----------
Probability:  tensor([[0.2650, 0.7350]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4757-0.4255j, 0.5738+0.5132j]])
New state:  tensor([[0.4668-0.4156j, 0.5810+0.5213j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4668-0.4156j, 0.5810+0.5213j]])
New state:  tensor([[-0.0744-0.6618j,  0.7416+0.0805j]])
----------Measure----------
Probability:  tensor([[0.4435, 0.5565]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5738-0.6415j, 0.3395+0.3795j]])
New state:  tensor([[0.5672-0.6356j, 0.3504+0.3893j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5672-0.6356j, 0.3504+0.3893j]])
New state:  tensor([[0.1588-0.7262j, 0.6475-0.1679j]])
----------Measure----------
Probability:  tensor([[0.5526, 0.4474]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.6041j, 0.3777+0.3920j]])
New state:  tensor([[0.5752-0.5975j, 0.3880+0.4019j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5752-0.5975j, 0.3880+0.4019j]])
New state:  tensor([[0.1382-0.7078j, 0.6800-0.1322j]])
----------Measure----------
Probability:  tensor([[0.5201, 0.4799]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7116-0.5434j, 0.3509+0.2742j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7116-0.5434j, 0.3509+0.2742j]])
New state:  tensor([[0.2616-0.5797j, 0.7491-0.1854j]])
----------Measure----------
Probability:  tensor([[0.4045, 0.5955]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4006-0.5666j, 0.4157+0.5879j]])
New state:  tensor([[0.3904-0.5593j, 0.4254+0.5948j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.3904-0.5593j, 0.4254+0.5948j]])
New state:  tensor([[-0.0198-0.8158j,  0.5771+0.0321j]])
----------Measure----------
Probability:  tensor([[0.6659, 0.3341]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.4843-0.3143j, 0.6849+0.4444j]])
New state:  tensor([[0.4766-0.3024j, 0.6902+0.4527j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.4766-0.3024j, 0.6902+0.4527j]])
New state:  tensor([[-0.1440-0.5330j,  0.8264+0.1109j]])
----------Measure----------
Probability:  tensor([[0.3049, 0.6951]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6879-0.2869j, 0.6153+0.2566j]])
New state:  tensor([[0.6834-0.2763j, 0.6202+0.2684j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6834-0.2763j, 0.6202+0.2684j]])
New state:  tensor([[0.0527-0.3852j, 0.9213-0.0022j]])
----------Measure----------
Probability:  tensor([[0.1511, 0.8489]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6018-0.7258j, 0.2128+0.2566j]])
New state:  tensor([[0.5973-0.7220j, 0.2252+0.2669j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5973-0.7220j, 0.2252+0.2669j]])
New state:  tensor([[0.2681-0.7020j, 0.5793-0.3158j]])
----------Measure----------
Probability:  tensor([[0.5647, 0.4353]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5821-0.3777j, 0.6041+0.3920j]])
New state:  tensor([[0.5752-0.3673j, 0.6105+0.4019j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5752-0.3673j, 0.6105+0.4019j]])
New state:  tensor([[-0.0177-0.5437j,  0.8386+0.0292j]])
----------Measure----------
Probability:  tensor([[0.2959, 0.7041]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6789-0.5629j, 0.3629+0.3009j]])
New state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6736-0.5566j, 0.3725+0.3125j]])
New state:  tensor([[0.2193-0.6160j, 0.7379-0.1673j]])
----------Measure----------
Probability:  tensor([[0.4276, 0.5724]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.2313-0.6542j, 0.2400+0.6789j]])
New state:  tensor([[0.2196-0.6500j, 0.2513+0.6828j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.2196-0.6500j, 0.2513+0.6828j]])
New state:  tensor([[-0.0195-0.9422j,  0.3331+0.0313j]])
----------Measure----------
Probability:  tensor([[0.8881, 0.1119]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5972-0.6197j, 0.3533+0.3666j]])
New state:  tensor([[0.5908-0.6136j, 0.3639+0.3769j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5908-0.6136j, 0.3639+0.3769j]])
New state:  tensor([[0.1662-0.7018j, 0.6737-0.1613j]])
----------Measure----------
Probability:  tensor([[0.5201, 0.4799]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5714-0.4382j, 0.5506+0.4223j]])
New state:  tensor([[0.5640-0.4287j, 0.5581+0.4321j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5640-0.4287j, 0.5581+0.4321j]])
New state:  tensor([[0.0110-0.6086j, 0.7934+0.0076j]])
----------Measure----------
Probability:  tensor([[0.3705, 0.6295]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7314-0.6542j, 0.1434+0.1283j]])
New state:  tensor([[0.7291-0.6516j, 0.1547+0.1409j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7291-0.6516j, 0.1547+0.1409j]])
New state:  tensor([[0.4115-0.5635j, 0.6214-0.3563j]])
----------Measure----------
Probability:  tensor([[0.4869, 0.5131]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.5342-0.5543j, 0.4429+0.4596j]])
New state:  tensor([[0.5262-0.5466j, 0.4524+0.4687j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.5262-0.5466j, 0.4524+0.4687j]])
New state:  tensor([[0.0581-0.7184j, 0.6915-0.0489j]])
----------Measure----------
Probability:  tensor([[0.5195, 0.4805]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7163-0.5493j, 0.3415+0.2619j]])
New state:  tensor([[0.7116-0.5434j, 0.3509+0.2742j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.7116-0.5434j, 0.3509+0.2742j]])
New state:  tensor([[0.2616-0.5797j, 0.7491-0.1854j]])
----------Measure----------
Probability:  tensor([[0.4045, 0.5955]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6500-0.3099j, 0.6264+0.2986j]])
New state:  tensor([[0.6448-0.2990j, 0.6316+0.3097j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6448-0.2990j, 0.6316+0.3097j]])
New state:  tensor([[0.0171-0.4304j, 0.9024+0.0113j]])
----------Measure----------
Probability:  tensor([[0.1855, 0.8145]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.7027-0.2485j, 0.6285+0.2222j]])
New state:  tensor([[0.6988-0.2376j, 0.6327+0.2343j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6988-0.2376j, 0.6327+0.2343j]])
New state:  tensor([[0.0548-0.3337j, 0.9411+0.0005j]])
----------Measure----------
Probability:  tensor([[0.1143, 0.8857]])
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.0344+0.j]])
rx_matrix:  tensor([[0.9999+0.0000j, 0.0000+0.0172j],
        [0.0000+0.0172j, 0.9999+0.0000j]])
Performing matrix multiplication

Current state:  tensor([[0.6573-0.3514j, 0.5879+0.3143j]])
New state:  tensor([[0.6518-0.3412j, 0.5939+0.3255j]])
Inside  ry
ry_matrix theta:  tensor([[1.5536+0.j]])
ry_matrix:  tensor([[ 0.7132-0.j, -0.7010-0.j],
        [ 0.7010+0.j,  0.7132-0.j]])
Performing matrix multiplication

Current state:  tensor([[0.6518-0.3412j, 0.5939+0.3255j]])
New state:  tensor([[0.0485-0.4715j, 0.8805-0.0070j]])
----------Measure----------
Probability:  tensor([[0.2247, 0.7753]])
test set accuracy: 0.8275862336158752
test set loss: 0.49404269456863403
