Classes
This part is the classes of the Python-Julia package which written in Python.
Dynamics¶
The dynamics of a density matrix is of the form
where \(\rho\) is the evolved density matrix, \(H\) is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and the corresponding decay rate.
Attributes¶
tspan:
array
-- Time length for the evolution.rho0:
matrix
-- Initial state (density matrix).H0:
matrix or list
-- Free Hamiltonian. It is a matrix when the free Hamiltonian is time- independent and a list with the length equal totspan
when it is time-dependent.dH:
list
-- Derivatives of the free Hamiltonian with respect to the unknown parameters to be estimated. For example, dH[0] is the derivative vector on the first parameter.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule is decay=[[\(\Gamma_1\), \(\gamma_1\)], [\(\Gamma_2\), \(\gamma_2\)],...], where \(\Gamma_1\) \((\Gamma_2)\) represents the decay operator and \(\gamma_1\) \((\gamma_2)\) is the corresponding decay rate.Hc:
list
-- Control Hamiltonians.ctrl:
list of arrays
-- Control coefficients.
Source code in quanestimation/Parameterization/GeneralDynamics.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
expm()
¶
Calculation of the density matrix and its derivatives on the unknown parameters with matrix exponential method (expm). The density matrix at \(j\)th time interval is obtained by \(\rho_j=e^{\Delta t\mathcal{L}}\rho_{j-1}\), where \(\Delta t\) is the time interval and \(\rho_{j-1}\) is the density matrix for the \((j-1)\)th time interval. \(\partial_{\textbf{x}}\rho_j\) is calculated as \begin{align} \partial_{\textbf{x}}\rho_j =\Delta t(\partial_{\textbf{x}}\mathcal{L})\rho_j +e^{\Delta t \mathcal{L}}(\partial_{\textbf{x}}\rho_{j-1}). \end{align}
Source code in quanestimation/Parameterization/GeneralDynamics.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
ode()
¶
Calculation of the density matrix and its derivatives on the unknown parameters with ordinary differential equations (ODE) solver. The density matrix at \(j\)th time interval is obtained by \(\rho_j=e^{\Delta t\mathcal{L}}\rho_{j-1}\), where \(\Delta t\) is the time interval and \(\rho_{j-1}\) is the density matrix for the \((j-1)\)th time interval. \(\partial_{\textbf{x}}\rho_j\) is calculated as \begin{align} \partial_{\textbf{x}}\rho_j =\Delta t(\partial_{\textbf{x}}\mathcal{L})\rho_j +e^{\Delta t \mathcal{L}}(\partial_{\textbf{x}}\rho_{j-1}). \end{align}
Source code in quanestimation/Parameterization/GeneralDynamics.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
secondorder_derivative(d2H)
¶
Calculation of the density matrix and its derivatives and the second derivatives on \(\textbf{x}\). The density matrix at \(j\)th time interval is obtained by \(\rho_j=e^{\Delta t\mathcal{L}}\rho_{j-1}\), where \(\Delta t\) is the time interval and \(\rho_{j-1}\) is the density matrix for the \((j-1)\)th time interval. \(\partial_{\textbf{x}}\rho_j\) is calculated via \begin{align} \partial_{\textbf{x}}\rho_j =\Delta t(\partial_{\textbf{x}}\mathcal{L})\rho_j +e^{\Delta t \mathcal{L}}(\partial_{\textbf{x}}\rho_{j-1}). \end{align}
\(\partial_{\textbf{x}}^2\rho_j\) is solved as \begin{align} \partial_{\textbf{x}}^2\rho_j =\Delta t(\partial_{\textbf{x}}^2\mathcal{L})\rho_j +\Delta t(\partial_{\textbf{x}}\mathcal{L})\partial_{\textbf{x}}\rho_j +\Delta t(\partial_{\textbf{x}}\mathcal{L})e^{\Delta t \mathcal{L}} \partial_{\textbf{x}}\rho_{j-1} +e^{\Delta t \mathcal{L}}(\partial_{\textbf{x}}^2\rho_{j-1}). \end{align}
Parameters¶
d2H:
list
-- Second order derivatives of the free Hamiltonian on the unknown parameters to be estimated.
Source code in quanestimation/Parameterization/GeneralDynamics.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
Control Optimization¶
The Hamiltonian of a controlled system can be written as \begin{align} H = H_0(\textbf{x})+\sum_{k=1}^K u_k(t) H_k, \end{align}
where \(H_0(\textbf{x})\) is the free evolution Hamiltonian with unknown parameters
\(\textbf{x}\) and \(H_k\) represents the \(k\)th control Hamiltonian with \(u_k\) the
corresponding control coefficient. In QuanEstimation, different algorithms are invoked to
update the optimal control coefficients. The control optimization algorithms are
gradient ascent pulse engineering (GRAPE), GRAPE algorithm based on the automatic
differentiation (auto-GRAPE), particle swarm optimization (PSO),
differential evolution (DE) and deep deterministic policy gradients (DDPG).
Base¶
Attributes¶
savefile:
bool
-- Whether or not to save all the control coeffients.
If setTrue
then the control coefficients and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the control coefficients in the final episode and the values of the objective function in all episodes will be saved.ctrl0:
list of arrays
-- Initial guesses of control coefficients.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load control coefficients in the current location.
If setTrue
then the program will load control coefficients from "controls.csv" file in the current location and use it as the initial control coefficients.
Source code in quanestimation/ControlOpt/ControlStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/ControlStruct.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Notes: (1) In single parameter estimation, HCRB is equivalent to QFI, please choose QFI as the objective function. (2) GRAPE and auto-GRAPE are not available when the objective function is HCRB. Supported methods are PSO, DE and DDPG.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ControlOpt/ControlStruct.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/ControlOpt/ControlStruct.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
|
dynamics(tspan, rho0, H0, dH, Hc, decay=[], ctrl_bound=[], dyn_method='expm')
¶
The dynamics of a density matrix is of the form
where \(\rho\) is the evolved density matrix, H is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and corresponding decay rate.
Parameters¶
tspan:
array
-- Time length for the evolution.rho0:
matrix
-- Initial state (density matrix).H0:
matrix or list
-- Free Hamiltonian. It is a matrix when the free Hamiltonian is time- independent and a list of length equal totspan
when it is time-dependent.dH:
list
-- Derivatives of the free Hamiltonian on the unknown parameters to be estimated. For example, dH[0] is the derivative vector on the first parameter.Hc:
list
-- Control Hamiltonians.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule is decay=[[\(\Gamma_1\), \(\gamma_1\)], [\(\Gamma_2\),\(\gamma_2\)],...], where \(\Gamma_1\) \((\Gamma_2)\) represents the decay operator and \(\gamma_1\) \((\gamma_2)\) is the corresponding decay rate.ctrl_bound:
array
-- Lower and upper bounds of the control coefficients.ctrl_bound[0]
represents the lower bound of the control coefficients andctrl_bound[1]
represents the upper bound of the control coefficients.dyn_method:
string
-- Setting the method for solving the Lindblad dynamics. Options are:
"expm" (default) -- Matrix exponential.
"ode" -- Solving the differential equations directly.
Source code in quanestimation/ControlOpt/ControlStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
mintime(f, W=[], M=[], method='binary', target='QFIM', LDtype='SLD')
¶
Search of the minimum time to reach a given value of the objective function.
Parameters¶
f:
float
-- The given value of the objective function.W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).method:
string
-- Methods for searching the minimum time to reach the given value of the objective function. Options are:
"binary" (default) -- Binary search (logarithmic search).
"forward" -- Forward search from the beginning of time.target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- Choose QFI (QFIM) as the objective function.
"CFIM" -- Choose CFI (CFIM) as the objective function.
"HCRB" -- Choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/ControlOpt/ControlStruct.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
|
Control optimization with GRAPE and auto-GRAPE¶
Bases: ControlSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the control coeffients.
If setTrue
then the control coefficients and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the control coefficients in the final episode and the values of the objective function in all episodes will be saved.Adam:
bool
-- Whether or not to use Adam for updating control coefficients.ctrl0:
list of arrays
-- Initial guesses of control coefficients.max_episode:
int
-- The number of episodes.epsilon:
float
-- Learning rate.beta1:
float
-- The exponential decay rate for the first moment estimates.beta2:
float
-- The exponential decay rate for the second moment estimates.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load control coefficients in the current location.
If setTrue
then the program will load control coefficients from "controls.csv" file in the current location and use it as the initial control coefficients.auto:
bool
-- Whether or not to invoke automatic differentiation algorithm to evaluate
the gradient. If setTrue
then the gradient will be calculated with automatic differentiation algorithm otherwise it will be calculated using analytical method.
Source code in quanestimation/ControlOpt/GRAPE_Copt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/GRAPE_Copt.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
HCRB(W=[])
¶
GRAPE and auto-GRAPE are not available when the objective function is HCRB. Supported methods are PSO, DE and DDPG.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ControlOpt/GRAPE_Copt.py
178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/ControlOpt/GRAPE_Copt.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
mintime(f, W=[], M=[], method='binary', target='QFIM', LDtype='SLD')
¶
Search of the minimum time to reach a given value of the objective function.
Parameters¶
f:
float
-- The given value of the objective function.W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).method:
string
-- Methods for searching the minimum time to reach the given value of the objective function. Options are:
"binary" (default) -- Binary search (logarithmic search).
"forward" -- Forward search from the beginning of time.target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- Choose QFI (QFIM) as the objective function.
"CFIM" -- Choose CFI (CFIM) as the objective function.
"HCRB" -- Choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/GRAPE_Copt.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
Control Optimization with PSO¶
Bases: ControlSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the control coeffients.
If setTrue
then the control coefficients and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the control coefficients in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of particles.ctrl0:
list of arrays
-- Initial guesses of control coefficients.max_episode:
int or list
-- If it is an integer, for example max_episode=1000, it means the program will continuously run 1000 episodes. However, if it is an array, for example max_episode=[1000,100], the program will run 1000 episodes in total but replace control coefficients of all the particles with global best every 100 episodes.c0:
float
-- The damping factor that assists convergence, also known as inertia weight.c1:
float
-- The exploitation weight that attracts the particle to its best previous position, also known as cognitive learning factor.c2:
float
-- The exploitation weight that attracts the particle to the best position
in the neighborhood, also known as social learning factor.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load control coefficients in the current location.
If setTrue
then the program will load control coefficients from "controls.csv" file in the current location and use it as the initial control coefficients.
Source code in quanestimation/ControlOpt/PSO_Copt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/PSO_Copt.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Note: in single parameter estimation, HCRB is equivalent to QFI, please choose QFI as the objective function.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ControlOpt/PSO_Copt.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/ControlOpt/PSO_Copt.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
mintime(f, W=[], M=[], method='binary', target='QFIM', LDtype='SLD')
¶
Search of the minimum time to reach a given value of the objective function.
Parameters¶
f:
float
-- The given value of the objective function.W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).method:
string
-- Methods for searching the minimum time to reach the given value of the objective function. Options are:
"binary" (default) -- Binary search (logarithmic search).
"forward" -- Forward search from the beginning of time.target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- Choose QFI (QFIM) as the objective function.
"CFIM" -- Choose CFI (CFIM) as the objective function.
"HCRB" -- Choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/PSO_Copt.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
Control Optimization DE¶
Bases: ControlSystem
Attributes¶
savefile:
bool
--Whether or not to save all the control coeffients.
If setTrue
then the control coefficients and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the control coefficients in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of populations.ctrl0: list of arrays -- Initial guesses of control coefficients.
max_episode:
int
-- The number of episodes.c:
float
-- Mutation constant.cr:
float
-- Crossover constant.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load control coefficients in the current location.
If setTrue
then the program will load control coefficients from "controls.csv" file in the current location and use it as the initial control coefficients.
Source code in quanestimation/ControlOpt/DE_Copt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/DE_Copt.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Note: in single parameter estimation, HCRB is equivalent to QFI, please choose QFI as the objective function.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ControlOpt/DE_Copt.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/ControlOpt/DE_Copt.py
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 |
|
mintime(f, W=[], M=[], method='binary', target='QFIM', LDtype='SLD')
¶
Search of the minimum time to reach a given value of the objective function.
Parameters¶
f:
float
-- The given value of the objective function.W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).method:
string
-- Methods for searching the minimum time to reach the given value of the objective function. Options are:
"binary" (default) -- Binary search (logarithmic search).
"forward" -- Forward search from the beginning of time.target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- Choose QFI (QFIM) as the objective function.
"CFIM" -- Choose CFI (CFIM) as the objective function.
"HCRB" -- Choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ControlOpt/DE_Copt.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
State Optimization¶
The probe state is expanded as \(|\psi\rangle=\sum_i c_i|i\rangle\) in a specific basis, i.e., \(\{|i\rangle\}\). In state optimization, the search of the optimal probe states is equal to search of the normalized complex coefficients \(\{c_i\}\). In QuanEstimation, the state optimization algorithms are automatic differentiation (AD), reverse iterative (RI) algorithm, particle swarm optimization (PSO), differential evolution (DE), deep deterministic policy gradients (DDPG) and Nelder-Mead (NM).
Base¶
Attributes¶
savefile:
bool
-- Whether or not to save all the states. If setTrue
then the states and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the state in the final episode and the values of the objective function in all episodes will be saved.psi0:
list of arrays
-- Initial guesses of states.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load states in the current location. If setTrue
then the program will load state from "states.csv" file in the current location and use it as the initial state.
Source code in quanestimation/StateOpt/StateStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/StateOpt/StateStruct.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Notes: (1) In single parameter estimation, HCRB is equivalent to QFI, please
choose QFI as the objective function. (2) GRAPE and auto-GRAPE are not available
when the objective function is HCRB. Supported methods are PSO, DE and DDPG.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/StateStruct.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
|
Kraus(K, dK)
¶
The parameterization of a state is \begin{align} \rho=\sum_i K_i\rho_0K_i^{\dagger}, \end{align}
where \(\rho\) is the evolved density matrix, \(K_i\) is the Kraus operator.
Parameters¶
K:
list
-- Kraus operators.dK:
list
-- Derivatives of the Kraus operators on the unknown parameters to be estimated. For example, dK[0] is the derivative vector on the first parameter.
Source code in quanestimation/StateOpt/StateStruct.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are: "SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD). "RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD). "LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/StateOpt/StateStruct.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
dynamics(tspan, H0, dH, Hc=[], ctrl=[], decay=[], dyn_method='expm')
¶
The dynamics of a density matrix is of the form
where \(\rho\) is the evolved density matrix, H is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and corresponding decay rate.
Parameters¶
tspan:
array
-- Time length for the evolution.H0:
matrix or list
-- Free Hamiltonian. It is a matrix when the free Hamiltonian is time- independent and a list of length equal totspan
when it is time-dependent.dH:
list
-- Derivatives of the free Hamiltonian on the unknown parameters to be estimated. For example, dH[0] is the derivative vector on the first parameter.Hc:
list
-- Control Hamiltonians.ctrl:
list of arrays
-- Control coefficients.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule is decay=[[\(\Gamma_1\), \(\gamma_1\)], [\(\Gamma_2\),\(\gamma_2\)],...], where \(\Gamma_1\) \((\Gamma_2)\) represents the decay operator and \(\gamma_1\) \((\gamma_2)\) is the corresponding decay rate.dyn_method:
string
-- Setting the method for solving the Lindblad dynamics. Options are:
"expm" (default) -- Matrix exponential.
"ode" -- Solving the differential equations directly.
Source code in quanestimation/StateOpt/StateStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
State optimization with AD¶
Bases: StateSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the states.
If setTrue
then the states and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the state in the final episode and the values of the objective function in all episodes will be saved.Adam:
bool
-- Whether or not to use Adam for updating states.psi0:
list of arrays
-- Initial guesses of states.max_episode:
int
-- The number of episodes.epsilon:
float
-- Learning rate.beta1:
float
-- The exponential decay rate for the first moment estimates.beta2:
float
-- The exponential decay rate for the second moment estimates.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load states in the current location.
If setTrue
then the program will load state from "states.csv" file in the current location and use it as the initial state.
Source code in quanestimation/StateOpt/AD_Sopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/StateOpt/AD_Sopt.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
HCRB(W=[])
¶
AD is not available when the objective function is HCRB. Supported methods are PSO, DE, DDPG and NM.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/AD_Sopt.py
117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/StateOpt/AD_Sopt.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
State optimization with RI¶
Bases: StateSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the states.
If setTrue
then the states and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the state in the final episode and the values of the objective function in all episodes will be saved.psi0:
list of arrays
-- Initial guesses of states.max_episode:
int
-- The number of episodes.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load states in the current location.
If setTrue
then the program will load state from "states.csv" file in the current location and use it as the initial state.
Source code in quanestimation/StateOpt/RI_Sopt.py
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 100 101 |
|
CFIM(M=[], W=[])
¶
Choose CFIM as the objective function.
Note: CFIM is not available.
Parameters¶
M:
list
-- POVM.W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/RI_Sopt.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Note: Here HCRB is not available.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/RI_Sopt.py
90 91 92 93 94 95 96 97 98 99 100 101 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI as the objective function.
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Only SLD can is available here.
Source code in quanestimation/StateOpt/RI_Sopt.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
State Optimization with PSO¶
Bases: StateSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the states.
If setTrue
then the states and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the state in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of particles.psi0:
list of arrays
-- Initial guesses of states.max_episode:
int or list
-- If it is an integer, for example max_episode=1000, it means the program will continuously run 1000 episodes. However, if it is an array, for example max_episode=[1000,100], the program will run 1000 episodes in total but replace states of all the particles with global best every 100 episodes.c0:
float
-- The damping factor that assists convergence, also known as inertia weight.c1:
float
-- The exploitation weight that attracts the particle to its best previous position, also known as cognitive learning factor.c2:
float
-- The exploitation weight that attracts the particle to the best position
in the neighborhood, also known as social learning factor.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load states in the current location. If setTrue
then the program will load state from "states.csv" file in the current location and use it as the initial state.
Source code in quanestimation/StateOpt/PSO_Sopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/StateOpt/PSO_Sopt.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Note: in single parameter estimation, HCRB is equivalent to QFI, please choose QFI as the objective function.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/PSO_Sopt.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/StateOpt/PSO_Sopt.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
State Optimization DE¶
Bases: StateSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the states.
If setTrue
then the states and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the state in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of populations.psi0:
list of arrays
-- Initial guesses of states.max_episode:
int
-- The number of episodes.c:
float
-- Mutation constant.cr:
float
-- Crossover constant.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load states in the current location.
If setTrue
then the program will load state from "states.csv" file in the current location and use it as the initial state.
Source code in quanestimation/StateOpt/DE_Sopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/StateOpt/DE_Sopt.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
HCRB(W=[])
¶
Choose HCRB as the objective function.
Note: in single parameter estimation, HCRB is equivalent to QFI, please choose QFI as the objective function.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/StateOpt/DE_Sopt.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
QFIM(W=[], LDtype='SLD')
¶
Choose QFI or \(\mathrm{Tr}(WF^{-1})\) as the objective function. In single parameter estimation the objective function is QFI and in multiparameter estimation it will be \(\mathrm{Tr}(WF^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Source code in quanestimation/StateOpt/DE_Sopt.py
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 |
|
Measurement Optimization¶
In QuanEstimation, three measurement optimization scenarios are considered. The first one is to optimize a set of rank-one projective measurement, it can be written in a specific basis \(\{|\phi_i\rangle\}\) with \(|\phi_i\rangle=\sum_j C_{ij}|j\rangle\) in the Hilbert space as \(\{|\phi_i\rangle\langle\phi_i|\}\). In this case, the goal is to search a set of optimal coefficients \(C_{ij}\). The second scenario is to find the optimal linear combination of an input measurement \(\{\Pi_j\}\). The third scenario is to find the optimal rotated measurement of an input measurement. After rotation, the new measurement is \(\{U\Pi_i U^{\dagger}\}\), where \(U=\prod_k \exp(i s_k\lambda_k)\) with \(\lambda_k\) a SU(\(N\)) generator and \(s_k\) a real number in the regime \([0,2\pi]\). In this scenario, the goal is to search a set of optimal coefficients \(s_k\). Here different algorithms are invoked to search the optimal measurement include particle swarm optimization (PSO) [1], differential evolution (DE) [2], and automatic differentiation (AD) [[3]] (#Baydin2018).
Base¶
Attributes
mtype:
string
-- The type of scenarios for the measurement optimization. Options are:
"projection" (default) -- Optimization of rank-one projective measurements.
"input" -- Find the optimal linear combination or the optimal rotated measurement of a given set of POVM.minput:
list
-- In the case of optimization of rank-one projective measurements, theminput
should keep empty. For finding the optimal linear combination and the optimal rotated measurement of a given set of POVM, the input rule areminput=["LC", [Pi1,Pi2,...], m]
andminput=["LC", [Pi1,Pi2,...]]
respectively. Here[Pi1,Pi2,...]
represents a list of input POVM andm
is the number of operators of the output measurement.savefile:
bool
-- Whether or not to save all the measurements.
If setTrue
then the measurements and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the measurement in the final episode and the values of the objective function in all episodes will be saved.measurement0:
list of arrays
-- Initial guesses of measurements.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load measurements in the current location.
If setTrue
then the program will load measurement from "measurements.csv" file in the current location and use it as the initial measurement.dyn_method:
string
-- The method for solving the Lindblad dynamcs. Options are: "expm" (default) -- matrix exponential. "ode" -- ordinary differential equation solvers.
Source code in quanestimation/MeasurementOpt/MeasurementStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
|
CFIM(W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/MeasurementOpt/MeasurementStruct.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
|
Kraus(rho0, K, dK)
¶
The parameterization of a state is \begin{align} \rho=\sum_i K_i\rho_0K_i^{\dagger}, \end{align}
where \(\rho\) is the evolved density matrix, \(K_i\) is the Kraus operator.
Parameters¶
rho0:
matrix
-- Initial state (density matrix).K:
list
-- Kraus operators.dK:
list
-- Derivatives of the Kraus operators on the unknown parameters to be estimated. For example, dK[0] is the derivative vector on the first parameter.
Source code in quanestimation/MeasurementOpt/MeasurementStruct.py
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
|
dynamics(tspan, rho0, H0, dH, Hc=[], ctrl=[], decay=[], dyn_method='expm')
¶
The dynamics of a density matrix is of the form
where \(\rho\) is the evolved density matrix, H is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and corresponding decay rate.
Parameters¶
tspan:
array
-- Time length for the evolution.rho0:
matrix
-- Initial state (density matrix).H0:
matrix or list
-- Free Hamiltonian. It is a matrix when the free Hamiltonian is time- independent and a list of length equal totspan
when it is time-dependent.dH:
list
-- Derivatives of the free Hamiltonian on the unknown parameters to be estimated. For example, dH[0] is the derivative vector on the first parameter.Hc:
list
-- Control Hamiltonians.ctrl:
list of arrays
-- Control coefficients.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule is decay=[[\(\Gamma_1\), \(\gamma_1\)], [\(\Gamma_2\),\(\gamma_2\)],...], where \(\Gamma_1\) \((\Gamma_2)\) represents the decay operator and \(\gamma_1\) \((\gamma_2)\) is the corresponding decay rate.dyn_method:
string
-- Setting the method for solving the Lindblad dynamics. Options are:
"expm" (default) -- Matrix exponential.
"ode" -- Solving the differential equations directly.
Source code in quanestimation/MeasurementOpt/MeasurementStruct.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
|
Measurement optimization with AD¶
Bases: MeasurementSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the measurements.
If setTrue
then the measurements and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the measurement in the final episode and the values of the objective function in all episodes will be saved.Adam:
bool
-- Whether or not to use Adam for updating measurements.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int
-- The number of episodes.epsilon:
float
-- Learning rate.beta1:
float
-- The exponential decay rate for the first moment estimates.beta2:
float
-- The exponential decay rate for the second moment estimates.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load measurements in the current location.
If setTrue
then the program will load measurement from "measurements.csv" file in the current location and use it as the initial measurement.
Source code in quanestimation/MeasurementOpt/AD_Mopt.py
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 |
|
CFIM(W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/MeasurementOpt/AD_Mopt.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
Measurement Optimization with PSO¶
Bases: MeasurementSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the measurements.
If setTrue
then the measurements and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the measurement in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of particles.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int or list
-- If it is an integer, for example max_episode=1000, it means the program will continuously run 1000 episodes. However, if it is an array, for example max_episode=[1000,100], the program will run 1000 episodes in total but replace measurements of all the particles with global best every 100 episodes.c0:
float
-- The damping factor that assists convergence, also known as inertia weight.c1:
float
-- The exploitation weight that attracts the particle to its best previous position, also known as cognitive learning factor.c2:
float
-- The exploitation weight that attracts the particle to the best position
in the neighborhood, also known as social learning factor.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load measurements in the current location.
If setTrue
then the program will load measurement from "measurements.csv" file in the current location and use it as the initial measurement.
Source code in quanestimation/MeasurementOpt/PSO_Mopt.py
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 100 101 102 |
|
CFIM(W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/MeasurementOpt/PSO_Mopt.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
Measurement Optimization with DE¶
Bases: MeasurementSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the measurements.
If setTrue
then the measurements and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the measurement in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of populations.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int
-- The number of episodes.c:
float
-- Mutation constant.cr:
float
-- Crossover constant.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.load:
bool
-- Whether or not to load measurements in the current location.
If setTrue
then the program will load measurement from "measurements.csv" file in the current location and use it as the initial measurement.
Source code in quanestimation/MeasurementOpt/DE_Mopt.py
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 |
|
CFIM(W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/MeasurementOpt/DE_Mopt.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
Comprehensive Optimization¶
In order to obtain the optimal parameter estimation schemes, it is necessary to simultaneously optimize the probe state, control and measurement. The comprehensive optimization for the probe state and measurement (SM), the probe state and control (SC), the control and measurement (CM) and the probe state, control and measurement (SCM) are proposed for this. In QuanEstimation, the comprehensive optimization algorithms are particle swarm optimization (PSO), differential evolution (DE), and automatic differentiation (AD).
Base¶
Attributes¶
savefile:
bool
-- Whether or not to save all the optimized variables (probe states, control coefficients and measurements).
If setTrue
then the optimized variables and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the optimized variables in the final episode and the values of the objective function in all episodes will be saved.psi0:
list of arrays
-- Initial guesses of states.ctrl0:
list of arrays
-- Initial guesses of control coefficients.measurement0:
list of arrays
-- Initial guesses of measurements.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
|
CM(rho0, W=[])
¶
Comprehensive optimization of the control and measurement (CM).
Parameters¶
rho0:
matrix
-- Initial state (density matrix).W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
|
Kraus(K, dK)
¶
The parameterization of a state is \begin{align} \rho=\sum_i K_i\rho_0K_i^{\dagger}, \end{align}
where \(\rho\) is the evolved density matrix, \(K_i\) is the Kraus operator.
Parameters¶
K:
list
-- Kraus operators.dK:
list
-- Derivatives of the Kraus operators on the unknown parameters to be estimated. For example, dK[0] is the derivative vector on the first parameter.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
|
SC(W=[], M=[], target='QFIM', LDtype='SLD')
¶
Comprehensive optimization of the probe state and control (SC).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).target:
string
-- Objective functions for comprehensive optimization. Options are:
"QFIM" (default) -- choose QFI (QFIM) as the objective function.
"CFIM" -- choose CFI (CFIM) as the objective function.
"HCRB" -- choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
SCM(W=[])
¶
Comprehensive optimization of the probe state, control and measurement (SCM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
|
SM(W=[])
¶
Comprehensive optimization of the probe state and measurement (SM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 |
|
dynamics(tspan, H0, dH, Hc=[], ctrl=[], decay=[], ctrl_bound=[], dyn_method='expm')
¶
The dynamics of a density matrix is of the form
where \(\rho\) is the evolved density matrix, H is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and corresponding decay rate.
Parameters¶
tspan:
array
-- Time length for the evolution.H0:
matrix or list
-- Free Hamiltonian. It is a matrix when the free Hamiltonian is time- independent and a list of length equal totspan
when it is time-dependent.dH:
list
-- Derivatives of the free Hamiltonian on the unknown parameters to be estimated. For example, dH[0] is the derivative vector on the first parameter.Hc:
list
-- Control Hamiltonians.ctrl:
list of arrays
-- Control coefficients.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule is decay=[[\(\Gamma_1\), \(\gamma_1\)], [\(\Gamma_2\),\(\gamma_2\)],...], where \(\Gamma_1\) \((\Gamma_2)\) represents the decay operator and \(\gamma_1\) \((\gamma_2)\) is the corresponding decay rate.ctrl_bound:
array
-- Lower and upper bounds of the control coefficients.ctrl_bound[0]
represents the lower bound of the control coefficients andctrl_bound[1]
represents the upper bound of the control coefficients.dyn_method:
string
-- Setting the method for solving the Lindblad dynamics. Options are:
"expm" (default) -- Matrix exponential.
"ode" -- Solving the differential equations directly.
Source code in quanestimation/ComprehensiveOpt/ComprehensiveStruct.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
Comprehensive optimization with AD¶
Bases: ComprehensiveSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the optimized variables (probe states, control coefficients and measurements).
If setTrue
then the optimized variables and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the optimized variables in the final episode and the values of the objective function in all episodes will be saved.Adam:
bool
-- Whether or not to use Adam for updating.psi0:
list of arrays
-- Initial guesses of states.ctrl0:
list of arrays
-- Initial guesses of control coefficients.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int
-- The number of episodes.epsilon:
float
-- Learning rate.beta1:
float
-- The exponential decay rate for the first moment estimates.beta2:
float
-- The exponential decay rate for the second moment estimates.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.
Source code in quanestimation/ComprehensiveOpt/AD_Compopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
SC(W=[], M=[], target='QFIM', LDtype='SLD')
¶
Comprehensive optimization of the probe state and control (SC).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- choose QFI (QFIM) as the objective function.
"CFIM" -- choose CFI (CFIM) as the objective function.
"HCRB" -- choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: AD is only available when target is 'QFIM'.
Source code in quanestimation/ComprehensiveOpt/AD_Compopt.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
Comprehensive Optimization with PSO¶
Bases: ComprehensiveSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the optimized variables (probe states, control coefficients and measurements).
If setTrue
then the optimized variables and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the optimized variables in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of particles.psi0:
list of arrays
-- Initial guesses of states.ctrl0:
list of arrays
-- Initial guesses of control coefficients.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int or list
-- If it is an integer, for example max_episode=1000, it means the program will continuously run 1000 episodes. However, if it is an array, for example max_episode=[1000,100], the program will run 1000 episodes in total but replace states of all the particles with global best every 100 episodes.c0:
float
-- The damping factor that assists convergence, also known as inertia weight.c1:
float
-- The exploitation weight that attracts the particle to its best previous position, also known as cognitive learning factor.c2:
float
-- The exploitation weight that attracts the particle to the best position
in the neighborhood, also known as social learning factor.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.
Source code in quanestimation/ComprehensiveOpt/PSO_Compopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
CM(rho0, W=[])
¶
Comprehensive optimization of the control and measurement (CM).
Parameters¶
rho0:
matrix
-- Initial state (density matrix).W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/PSO_Compopt.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
SC(W=[], M=[], target='QFIM', LDtype='SLD')
¶
Comprehensive optimization of the probe state and control (SC).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- choose QFI (QFIM) as the objective function.
"CFIM" -- choose CFI (CFIM) as the objective function.
"HCRB" -- choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ComprehensiveOpt/PSO_Compopt.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
SCM(W=[])
¶
Comprehensive optimization of the probe state, the control and measurements (SCM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/PSO_Compopt.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
SM(W=[])
¶
Comprehensive optimization of the probe state and measurement (SM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/PSO_Compopt.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
Comprehensive Optimization with DE¶
Bases: ComprehensiveSystem
Attributes¶
savefile:
bool
-- Whether or not to save all the optimized variables (probe states, control coefficients and measurements).
If setTrue
then the optimized variables and the values of the objective function obtained in all episodes will be saved during the training. If setFalse
the optimized variables in the final episode and the values of the objective function in all episodes will be saved.p_num:
int
-- The number of populations.psi0:
list of arrays
-- Initial guesses of states.ctrl0:
list of arrays
-- Initial guesses of control coefficients.measurement0:
list of arrays
-- Initial guesses of measurements.max_episode:
int
-- The number of episodes.c:
float
-- Mutation constant.cr:
float
-- Crossover constant.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.
Source code in quanestimation/ComprehensiveOpt/DE_Compopt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
CM(rho0, W=[])
¶
Comprehensive optimization of the control and measurement (CM).
Parameters¶
rho0:
matrix
-- Initial state (density matrix).W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/DE_Compopt.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
SC(W=[], M=[], target='QFIM', LDtype='SLD')
¶
Comprehensive optimization of the probe state and control (SC).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).target:
string
-- Objective functions for searching the minimum time to reach the given value of the objective function. Options are:
"QFIM" (default) -- choose QFI (QFIM) as the objective function.
"CFIM" -- choose CFI (CFIM) as the objective function.
"HCRB" -- choose HCRB as the objective function.LDtype:
string
-- Types of QFI (QFIM) can be set as the objective function. Options are:
"SLD" (default) -- QFI (QFIM) based on symmetric logarithmic derivative (SLD).
"RLD" -- QFI (QFIM) based on right logarithmic derivative (RLD).
"LLD" -- QFI (QFIM) based on left logarithmic derivative (LLD).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/ComprehensiveOpt/DE_Compopt.py
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 100 101 102 103 104 105 106 107 108 109 |
|
SCM(W=[])
¶
Comprehensive optimization of the probe state, control and measurement (SCM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/DE_Compopt.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
SM(W=[])
¶
Comprehensive optimization of the probe state and measurement (SM).
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/ComprehensiveOpt/DE_Compopt.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
Adaptive measurement schemes¶
In QuanEstimation, the Hamiltonian of the adaptive system should be written as \(H(\textbf{x}+\textbf{u})\) with \(\textbf{x}\) the unknown parameters and \(\textbf{u}\) the tunable parameters. The tunable parameters \(\textbf{u}\) are used to let the Hamiltonian work at the optimal point \(\textbf{x}_{\mathrm{opt}}\).
Adaptive measurement¶
Attributes¶
x:
list
-- The regimes of the parameters for the integral.p:
multidimensional array
-- The prior distribution.rho0:
matrix
-- Initial state (density matrix).method:
string
-- Choose the method for updating the tunable parameters (u). Options are:
"FOP" (default) -- Fix optimal point.
"MI" -- mutual information.savefile:
bool
-- Whether or not to save all the posterior distributions.
If setTrue
then three files "pout.npy", "xout.npy" and "y.npy" will be generated including the posterior distributions, the estimated values, and the experimental results in the iterations. If setFalse
the posterior distribution in the final iteration, the estimated values and the experimental results in all iterations will be saved in "pout.npy", "xout.npy" and "y.npy".max_episode:
int
-- The number of episodes.eps:
float
-- Machine epsilon.
Source code in quanestimation/AdaptiveScheme/Adapt.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
|
CFIM(M=[], W=[])
¶
Choose CFI or \(\mathrm{Tr}(WI^{-1})\) as the objective function. In single parameter estimation the objective function is CFI and in multiparameter estimation it will be \(\mathrm{Tr}(WI^{-1})\).
Parameters¶
W:
matrix
-- Weight matrix.M:
list of matrices
-- A set of positive operator-valued measure (POVM). The default measurement is a set of rank-one symmetric informationally complete POVM (SIC-POVM).
Note: SIC-POVM is calculated by the Weyl-Heisenberg covariant SIC-POVM fiducial state which can be downloaded from here.
Source code in quanestimation/AdaptiveScheme/Adapt.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
Kraus(K, dK)
¶
Dynamics of the density matrix of the form \begin{align} \rho=\sum_i K_i\rho_0K_i^{\dagger} \end{align}
where \(\rho\) is the evolved density matrix, \(K_i\) is the Kraus operator.
Parameters¶
K:
multidimensional list
-- Kraus operator(s) with respect to the values in x.dK:
multidimensional list
-- Derivatives of the Kraus operator(s) with respect to the unknown parameters to be estimated.
Source code in quanestimation/AdaptiveScheme/Adapt.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
Mopt(W=[])
¶
Measurement optimization for the optimal x.
Parameters¶
W:
matrix
-- Weight matrix.
Source code in quanestimation/AdaptiveScheme/Adapt.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
|
dynamics(tspan, H, dH, Hc=[], ctrl=[], decay=[], dyn_method='expm')
¶
Dynamics of the density matrix of the form
where \(\rho\) is the evolved density matrix, H is the Hamiltonian of the system, \(\Gamma_i\) and \(\gamma_i\) are the \(i\mathrm{th}\) decay operator and decay rate.
Parameters¶
tspan:
array
-- Time length for the evolution.H0:
multidimensional list
-- Free Hamiltonian with respect to the values in x.dH:
multidimensional list
-- Derivatives of the free Hamiltonian with respect to the unknown parameters to be estimated.Hc:
list
-- Control Hamiltonians.ctrl:
list
-- Control coefficients.decay:
list
-- Decay operators and the corresponding decay rates. Its input rule isdecay=[[Gamma1, gamma1], [Gamma2,gamma2],...]
, whereGamma1 (Gamma2)
represents the decay operator andgamma1 (gamma2)
is the corresponding decay rate.dyn_method:
string
-- Setting the method for solving the Lindblad dynamics. Options are:
"expm" (default) -- Matrix exponential.
"ode" -- Solving the differential equations directly.
Source code in quanestimation/AdaptiveScheme/Adapt.py
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 100 101 102 103 104 105 106 107 |
|
Attributes¶
x:
list
-- The regimes of the parameters for the integral.p:
multidimensional array
-- The prior distribution.rho0:
matrix
-- Initial state (density matrix).
Source code in quanestimation/AdaptiveScheme/Adapt_MZI.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
offline(target='sharpness', method='DE', p_num=10, deltaphi0=[], c=1.0, cr=0.5, c0=1.0, c1=2.0, c2=2.0, seed=1234, max_episode=1000, eps=1e-08)
¶
Parameters¶
target:
string
-- Setting the target function for calculating the tunable phase. Options are:
"sharpness" (default) -- Sharpness.
"MI" -- Mutual information.method:
string
-- The method for the adaptive phase estimation. Options are:
"DE" (default) -- DE algorithm for the adaptive phase estimation.
"PSO" -- PSO algorithm for the adaptive phase estimation.
If the method=DE
, the parameters are:
p_num:
int
-- The number of populations.deltaphi0:
list
-- Initial guesses of phase difference.max_episode:
int
-- The number of episodes.c:
float
-- Mutation constant.cr:
float
-- Crossover constant.seed:
int
-- Random seed.eps:
float
-- Machine epsilon.
If the method=PSO
, the parameters are:
deltaphi0:
list
-- Initial guesses of phase difference.max_episode:
int or list
-- If it is an integer, for example max_episode=1000, it means the program will continuously run 1000 episodes. However, if it is an array, for example max_episode=[1000,100], the program will run 1000 episodes in total but replace states of all the particles with global best every 100 episodes.c0:
float
-- The damping factor that assists convergence, also known as inertia weight.c1:
float
-- The exploitation weight that attracts the particle to its best previous position, also known as cognitive learning factor.c2:
float
-- The exploitation weight that attracts the particle to the best position
in the neighborhood, also known as social learning factor.eps:
float
-- Machine epsilon.
Source code in quanestimation/AdaptiveScheme/Adapt_MZI.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
online(target='sharpness', output='phi')
¶
Parameters¶
target:
string
-- Setting the target function for calculating the tunable phase. Options are:
"sharpness" (default) -- Sharpness.
"MI" -- Mutual information.output:
string
-- The output the class. Options are:
"phi" (default) -- The tunable phase.
"dphi" -- Phase difference.
Source code in quanestimation/AdaptiveScheme/Adapt_MZI.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|