@@ -47,15 +47,15 @@ def test_estimator(self):
4747 observable = PauliSumOp .from_list (lst )
4848 ansatz = RealAmplitudes (num_qubits = 2 , reps = 2 )
4949 with Estimator ([ansatz ], [observable ]) as est :
50- result = est (parameters = [0 , 1 , 1 , 2 , 3 , 5 ])
50+ result = est (parameter_values = [0 , 1 , 1 , 2 , 3 , 5 ])
5151 self .assertIsInstance (result , EstimatorResult )
5252 np .testing .assert_allclose (result .values , [1.84209213 ])
5353
5454 with self .subTest ("SparsePauliOp" ):
5555 observable = SparsePauliOp .from_list (lst )
5656 ansatz = RealAmplitudes (num_qubits = 2 , reps = 2 )
5757 with Estimator ([ansatz ], [observable ]) as est :
58- result = est (parameters = [0 , 1 , 1 , 2 , 3 , 5 ])
58+ result = est (parameter_values = [0 , 1 , 1 , 2 , 3 , 5 ])
5959 self .assertIsInstance (result , EstimatorResult )
6060 np .testing .assert_allclose (result .values , [1.84209213 ])
6161
@@ -64,7 +64,7 @@ def test_estimator_param_reverse(self):
6464 observable = PauliSumOp .from_list ([("XX" , 1 ), ("YY" , 2 ), ("ZZ" , 3 )])
6565 ansatz = RealAmplitudes (num_qubits = 2 , reps = 2 )
6666 with Estimator ([ansatz ], [observable ], [ansatz .parameters [::- 1 ]]) as est :
67- result = est (parameters = [0 , 1 , 1 , 2 , 3 , 5 ][::- 1 ])
67+ result = est (parameter_values = [0 , 1 , 1 , 2 , 3 , 5 ][::- 1 ])
6868 self .assertIsInstance (result , EstimatorResult )
6969 np .testing .assert_allclose (result .values , [1.84209213 ])
7070
@@ -98,14 +98,14 @@ def test_init_observable_from_operator(self):
9898 def test_evaluate (self ):
9999 """test for evaluate"""
100100 with Estimator ([self .ansatz ], [self .observable ]) as est :
101- result = est (parameters = [0 , 1 , 1 , 2 , 3 , 5 ])
101+ result = est (parameter_values = [0 , 1 , 1 , 2 , 3 , 5 ])
102102 self .assertIsInstance (result , EstimatorResult )
103103 np .testing .assert_allclose (result .values , [- 1.284366511861733 ])
104104
105105 def test_evaluate_multi_params (self ):
106106 """test for evaluate with multiple parameters"""
107107 with Estimator ([self .ansatz ], [self .observable ]) as est :
108- result = est (parameters = [[0 , 1 , 1 , 2 , 3 , 5 ], [1 , 1 , 2 , 3 , 5 , 8 ]])
108+ result = est (parameter_values = [[0 , 1 , 1 , 2 , 3 , 5 ], [1 , 1 , 2 , 3 , 5 , 8 ]])
109109 self .assertIsInstance (result , EstimatorResult )
110110 np .testing .assert_allclose (result .values , [- 1.284366511861733 , - 1.3187526349078742 ])
111111
@@ -124,7 +124,7 @@ def test_run_with_multiple_observables_and_none_parameters(self):
124124 circuit .cx (0 , 1 )
125125 circuit .cx (1 , 2 )
126126 with Estimator (circuit , ["ZZZ" , "III" ]) as est :
127- result = est (circuits = [0 , 0 ], observables = [0 , 1 ])
127+ result = est (circuit_indices = [0 , 0 ], observable_indices = [0 , 1 ])
128128 self .assertIsInstance (result , EstimatorResult )
129129 np .testing .assert_allclose (result .values , [0.0 , 1.0 ])
130130
0 commit comments