forked from QuanEstimation/QuanEstimation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-results.xml
More file actions
99 lines (82 loc) · 8.79 KB
/
test-results.xml
File metadata and controls
99 lines (82 loc) · 8.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="1" skipped="0" tests="38" time="748.843" timestamp="2025-08-15T19:53:06.327882+08:00" hostname="Mac-Studio.local"><testcase classname="test.test_AnalogCramerRao" name="test_HCRB_NHB" time="0.105" /><testcase classname="test.test_AnalogCramerRao" name="test_HCRB_NHB_invalid_input" time="0.000" /><testcase classname="test.test_AnalogCramerRao" name="test_HCRB_print" time="0.002" /><testcase classname="test.test_BayesCramerRao" name="test_bayesian_bound" time="135.818" /><testcase classname="test.test_BayesCramerRao" name="test_bcfim_bqcfim_multiparameter" time="202.074"><failure message="juliacall.JuliaError: MethodError: no method matching pyjliter_next(::Nothing) The function `pyjliter_next` exists, but no method is defined for this combination of argument types. Closest candidates are: pyjliter_next(!Matched::PythonCall.JlWrap.Iterator) @ PythonCall ~/.julia/packages/PythonCall/avYrV/src/JlWrap/iter.jl:10 Stacktrace: [1] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64) @ PythonCall.JlWrap ~/.julia/packages/PythonCall/avYrV/src/JlWrap/base.jl:62 [2] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject}) @ PythonCall.JlWrap.Cjl ~/.julia/packages/PythonCall/avYrV/src/JlWrap/C.jl:63">def test_bcfim_bqcfim_multiparameter() -> None:
"""
Test function for BCFIM and BQFIM.
This function tests:
- Bayesian classical Fisher information in multiparameter scenario
- Bayesian quantum Fisher information in multiparameter scenario
"""
# Initial state
rho0 = 0.5 * np.array([[1.0, 1.0], [1.0, 1.0]])
# Free Hamiltonian parameters
b_val = 0.5 * np.pi
sigma_x = np.array([[0.0, 1.0], [1.0, 0.0]])
sigma_z = np.array([[1.0, 0.0], [0.0, -1.0]])
# Hamiltonian function
hamiltonian_func = lambda omega0, x: 0.5 * b_val * omega0 * (
sigma_x * np.cos(x) + sigma_z * np.sin(x)
)
# Derivative of Hamiltonian (return 2x2 matrices, not 1x2x2 arrays)
d_hamiltonian_func = lambda omega0, x: [
0.5 * b_val * (sigma_x * np.cos(x) + sigma_z * np.sin(x)),
0.5 * b_val * omega0 * (-sigma_x * np.sin(x) + sigma_z * np.cos(x))
]
# Prior distribution parameters
x_values = np.linspace(-0.5 * np.pi, 0.5 * np.pi, 100)
omega0_values = np.linspace(1, 2, 100)
all_parameter_values = [omega0_values, x_values]
# Joint probability density function (Gaussian for both parameters)
mu_omega0, mu_x = 1.5, 0.0
eta_omega0, eta_x = 0.2, 0.2
prob_density = lambda omega0, x: (
np.exp(-(omega0 - mu_omega0)**2 / (2 * eta_omega0**2)) / (eta_omega0 * np.sqrt(2 * np.pi))
* np.exp(-(x - mu_x)**2 / (2 * eta_x**2)) / (eta_x * np.sqrt(2 * np.pi))
)
# Generate probability values
prob_values_unnormalized = np.zeros((len(omega0_values), len(x_values)))
for i in range(len(omega0_values)):
for j in range(len(x_values)):
prob_values_unnormalized[i, j] = prob_density(omega0_values[i], x_values[j])
# Normalize the distribution
integral_x = np.zeros(len(omega0_values))
for i in range(len(omega0_values)):
integral_x[i] = simpson(prob_values_unnormalized[i, :], x_values)
norm_factor = simpson(integral_x, omega0_values)
prob_normalized = prob_values_unnormalized / norm_factor
# Time evolution parameters
time_span = np.linspace(0.0, 1.0, 50)
# Prepare arrays for states and derivatives
final_states = []
d_final_states = []
# Evolve the system for each parameter combination
for i in range(len(omega0_values)):
row_rho = []
row_drho = []
for j in range(len(x_values)):
hamiltonian = hamiltonian_func(omega0_values[i], x_values[j])
d_hamiltonian = d_hamiltonian_func(omega0_values[i], x_values[j])
dynamics = Lindblad(time_span, rho0, hamiltonian, d_hamiltonian)
> states, d_states = dynamics.expm()
^^^^^^^^^^^^^^^
test/test_BayesCramerRao.py:206:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
quanestimation/Parameterization/GeneralDynamics.py:149: in expm
drho = [[np.array(drho_ij) for drho_ij in drho_i] for drho_i in drho]
^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Julia: nothing
def __next__(self):
> return self._jl_callmethod($(pyjl_methodnum(pyjliter_next)))
^^^^^^^^^^^^^^^^^^^^^^^
E juliacall.JuliaError: MethodError: no method matching pyjliter_next(::Nothing)
E The function `pyjliter_next` exists, but no method is defined for this combination of argument types.
E
E Closest candidates are:
E pyjliter_next(!Matched::PythonCall.JlWrap.Iterator)
E @ PythonCall ~/.julia/packages/PythonCall/avYrV/src/JlWrap/iter.jl:10
E
E Stacktrace:
E [1] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64)
E @ PythonCall.JlWrap ~/.julia/packages/PythonCall/avYrV/src/JlWrap/base.jl:62
E [2] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject})
E @ PythonCall.JlWrap.Cjl ~/.julia/packages/PythonCall/avYrV/src/JlWrap/C.jl:63
/Users/liujing/.julia/packages/PythonCall/avYrV/src/JlWrap/iter.jl:39: JuliaError</failure></testcase><testcase classname="test.test_BayesEstimation" name="test_Bayes" time="251.420" /><testcase classname="test.test_Common" name="test_basis" time="0.000" /><testcase classname="test.test_Common" name="test_gramschmidt" time="0.000" /><testcase classname="test.test_Common" name="test_suN_generator" time="0.005" /><testcase classname="test.test_Common" name="test_mat_vec_convert" time="0.000" /><testcase classname="test.test_Common" name="test_SIC" time="0.001" /><testcase classname="test.test_Common" name="test_annihilation" time="0.000" /><testcase classname="test.test_Common" name="test_brgd" time="0.000" /><testcase classname="test.test_Common" name="test_BayesInput" time="0.000" /><testcase classname="test.test_Common" name="test_extract_ele" time="0.000" /><testcase classname="test.test_Common" name="test_fidelity" time="0.000" /><testcase classname="test.test_CramerRao" name="test_CramerRao_SLD" time="0.000" /><testcase classname="test.test_CramerRao" name="test_CFIM_singleparameter" time="0.000" /><testcase classname="test.test_CramerRao" name="test_QFIM_Kraus" time="0.001" /><testcase classname="test.test_CramerRao" name="test_QFIM_Bloch" time="0.002" /><testcase classname="test.test_CramerRao" name="test_QFIM_Bloch_pure" time="0.001" /><testcase classname="test.test_CramerRao" name="test_QFIM_Bloch_highdimension" time="0.003" /><testcase classname="test.test_CramerRao" name="test_QFIM_Gauss_multiparameter" time="0.001" /><testcase classname="test.test_CramerRao" name="test_QFIM_Gauss_singleparameter" time="0.001" /><testcase classname="test.test_CramerRao" name="test_QFIM_LLD_singleparameter" time="0.000" /><testcase classname="test.test_CramerRao" name="test_QFIM_RLD_singleparameter" time="0.000" /><testcase classname="test.test_CramerRao" name="test_FIM_singleparameter" time="0.000" /><testcase classname="test.test_CramerRao" name="test_FIM_multiparameter" time="0.000" /><testcase classname="test.test_CramerRao" name="test_FI_Expt" time="0.120" /><testcase classname="test.test_CramerRao" name="test_invalid_input" time="0.000" /><testcase classname="test.test_Parameterization" name="test_Kraus" time="0.000" /><testcase classname="test.test_Parameterization" name="test_Lindblad" time="8.392" /><testcase classname="test.test_Resource" name="test_SpinSqueezing_Dicke" time="0.000" /><testcase classname="test.test_Resource" name="test_SpinSqueezing_Pauli" time="0.000" /><testcase classname="test.test_Resource" name="test_SpinSqueezing_nomean" time="0.000" /><testcase classname="test.test_Resource" name="test_TargetTime" time="5.633" /><testcase classname="test.test_Resource" name="test_TargetTime_no_crossing" time="0.002" /><testcase classname="test.test_ZivZakai" name="test_ZivZakai" time="129.405" /></testsuite></testsuites>