qom.solvers.measure module¶
Module to solve for various classical and quantum signatures and system measures.
References
- class qom.solvers.measure.QCMSolver(Modes, Corrs, params: dict, cb_update=None)¶
Bases:
object
Class to solve for quantum correlation measures.
Initializes
Modes
,Corrs
,Omega_s
(symplectic matrix),params
andupdater
.- Parameters:
Modes (numpy.ndarray) – Classical modes with shape
(dim, num_modes)
.Corrs (numpy.ndarray) – Quadrature quadrature correlations with shape
(dim, 2 * num_modes, 2 * num_modes)
.params (dict) –
- Parameters for the solver. Available options are:
key
value
’show_progress’
(bool) option to display the progress of the solver. Default is
False
.’measure_codes’
(list or str) codenames of the measures to calculate. Options are
'discord_G'
for Gaussian quantum discord [3],'entan_ln'
for quantum entanglement (using matrix multiplications, fallback) [1],'entan_ln_2'
for quantum entanglement (using analytical expressions) [2],'sync_c'
for complete quantum synchronization [4],'sync_p'
for quantum phase synchronization [4]]). Default is['entan_ln']
.’indices’
(list or tuple) indices of the modes as a list or tuple of two integers. Default is
(0, 1)
.
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset)
, wherestatus
is a string,progress
is a float andreset
is a boolean.
- desc = 'Quantum Correlations Measure Solver'¶
Description of the solver.
- Type:
str
- get_correlation_Pearson(pos_i: int, pos_j: int)¶
Method to obtain the Pearson correlation coefficient.
The implementation measure reads as [6],
\[C_{ij} = \frac{\Sigma_{t} \langle \delta \mathcal{O}_{i} (t) \delta \mathcal{O}_{j} (t) \rangle}{\sqrt{\Sigma_{t} \langle \delta \mathcal{O}_{i}^{2} (t) \rangle} \sqrt{\Sigma_{t} \langle \delta \mathcal{O}_{j}^{2} (t) \rangle}}\]where \(\delta \mathcal{O}_{i}\) and \(\delta \mathcal{O}_{j}\) are the corresponding quadratures of quantum fluctuations.
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Corr_P – Pearson correlation coefficients.
- Return type:
float
- get_discord_Gaussian(pos_i: int, pos_j: int)¶
Method to obtain Gaussian quantum discord values [3].
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Discord_G – Gaussian quantum discord values.
- Return type:
numpy.ndarray
- get_entanglement_logarithmic_negativity(pos_i: int, pos_j: int)¶
Method to obtain the logarithmic negativity entanglement values using matrices [1].
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Entan_lns – Logarithmic negativity entanglement values using matrices.
- Return type:
numpy.ndarray
- get_entanglement_logarithmic_negativity_2(pos_i: int, pos_j: int)¶
Method to obtain the logarithmic negativity entanglement values using analytical expression [2].
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Entan_ln – Logarithmic negativity entanglement values using analytical expression.
- Return type:
numpy.ndarray
- get_invariants(pos_i: int, pos_j: int)¶
Helper function to calculate symplectic invariants for two modes given the correlation matrices of their quadratures.
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int8) – Index of jth quadrature.
- Returns:
I_1s (numpy.ndarray) – Determinants of
A
.I_2s (numpy.ndarray) – Determinants of
B
.I_3s (numpy.ndarray) – Determinants of
C
.I_4s (numpy.ndarray) – Determinants of
corrs_modes
.
- get_measures()¶
Method to obtain the each measure.
- Returns:
Measures – Measures calculated with shape
(dim, num_measure_codes)
.- Return type:
numpy.ndarray
- get_submatrices(pos_i: int, pos_j: int)¶
Helper function to obtain the block matrices of the required modes and its components.
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Corrs_modes (numpy.ndarray) – Correlation matrix of the required modes.
A (numpy.ndarray) – Correlation matrix of the first mode.
B (numpy.ndarray) – Correlation matrix of the first mode.
C (numpy.ndarray) – Correlation matrix of the cross mode.
- get_synchronization_complete(pos_i: int, pos_j: int)¶
Method to obtain the complete quantum synchronization values [5].
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Sync_c – Complete quantum synchronization values.
- Return type:
numpy.ndarray
- get_synchronization_phase(pos_i: int, pos_j: int)¶
Method to obtain the quantum phase synchronization values [5].
- Parameters:
pos_i (int) – Index of ith quadrature.
pos_j (int) – Index of jth quadrature.
- Returns:
Sync_p – Quantum phase synchronization values.
- Return type:
numpy.ndarray
- method_codes = {'corrs_P_p': 'get_correlation_Pearson', 'corrs_P_q': 'get_correlation_Pearson', 'discord_G': 'get_discord_Gaussian', 'entan_ln': 'get_entanglement_logarithmic_negativity', 'entan_ln_2': 'get_entanglement_logarithmic_negativity_2', 'sync_c': 'get_synchronization_complete', 'sync_p': 'get_synchronization_phase'}¶
Codenames of available methods.
- Type:
dict
- name = 'QCMSolver'¶
Name of the solver.
- Type:
str
- set_params(params: dict)¶
Method to validate and set the solver parameters.
- Parameters:
params (dict) – Parameters of the solver.
- solver_defaults = {'indices': (0, 1), 'measure_codes': ['entan_ln'], 'show_progress': False}¶
Default parameters of the solver.
- Type:
dict
- qom.solvers.measure.get_Lyapunov_exponents(system, modes, t=None, params: dict = {}, cb_update=None)¶
Method to obtain the Lyapunov exponents [8].
- Parameters:
system (
qom.systems.*
) – Instance of the system. Requires predefined system methodget_ivc
andget_A
.modes (numpy.ndarray) – Final classical modes with shape
(num_modes, )
.t (numpy.ndarray, optional) – Final time of the evolution.
params (dict) –
- Parameters for the solver. Refer to
qom.solvers.deterministic.ODESolver
for all available options. Additionally available options are: key
value
’show_progress’
(bool) option to display the progress of the solver. Default is
False
.’num_steps’
(int) number of additional time steps to calculate the deviations for Lyapunov exponents. Default value is
1000
.’step_size’
(float) step size of each time step. Default value is
0.1
.’use_svd’
(bool) option to use the singular value decomposition method to calculate the Lyapunov exponents. If
False
, the Gram-Schmidt orthonormalization method is used. Default isTrue
.
- Parameters for the solver. Refer to
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset)
, wherestatus
is a string,progress
is a float andreset
is a boolean.
- Returns:
lambdas – Lyapunov exponents with shape
(2 * num_modes, )
.- Return type:
numpy.ndarray
- qom.solvers.measure.get_Wigner_distributions_single_mode(Corrs, params, cb_update=None)¶
Method to obtain single-mode Wigner distribitions.
- Parameters:
Corrs (numpy.ndarray) – Quadrature quadrature correlations with shape
(dim, 2 * num_modes, 2 * num_modes)
.params (dict) –
- Parameters of the solver. Available options are:
key
value
’show_progress’
(bool) option to display the progress of the solver. Default is
False
.’indices’
(list or tuple) indices of the modes as a list. Default is
[0]
.’wigner_xs’
(list) X-axis values.
’wigner_ys’
(list) Y-axis values.
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset)
, wherestatus
is a string,progress
is a float andreset
is a boolean.
- Returns:
Wigners – Single-mode Wigner distributions of shape
(dim_1, dim_0, p_dim, q_dim)
, wheredim_1
anddim_0
are the first dimensions of the correlations and the indices respectively.- Return type:
numpy.ndarray
- qom.solvers.measure.get_Wigner_distributions_two_mode(Corrs, params, cb_update=None)¶
Method to obtain two-mode Wigner distribitions.
- Parameters:
Corrs (numpy.ndarray) – Quadrature quadrature correlations with shape
(dim, 2 * num_modes, 2 * num_modes)
.params (dict) –
- Parameters of the solver. Available options are:
key
value
’show_progress’
(bool) option to display the progress of the solver. Default is
False
.’indices’
(list or tuple) list of indices of the modes and their quadratures as tuples or lists. Default is
[(0, 0), (1, 0)]
.’wigner_xs’
(list) X-axis values.
’wigner_ys’
(list) Y-axis values.
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset)
, wherestatus
is a string,progress
is a float andreset
is a boolean.
- Returns:
Wigners – Two-mode Wigner distributions of shape
(dim_0, p_dim, q_dim)
, wheredim_0
is the first dimension of the correlations.- Return type:
numpy.ndarray
- qom.solvers.measure.get_average_amplitude_difference(Modes)¶
Method to obtain the average amplitude differences for two specific modes [7].
- Parameters:
Modes (numpy.ndarray) – The two specific modes with shape
(dim, 2)
.- Returns:
diff_a – The average amplitude difference.
- Return type:
float
- qom.solvers.measure.get_average_phase_difference(Modes)¶
Method to obtain the average phase differences for two specific modes [4].
- Parameters:
Modes (numpy.ndarray) – The two specific modes with shape
(dim, 2)
.- Returns:
diff_p – The average phase difference.
- Return type:
float
- qom.solvers.measure.get_bifurcation_amplitudes(Modes)¶
Method to obtain the bifurcation amplitudes of the modes.
- Parameters:
Modes (numpy.ndarray) – The mode amplitudes in the trajectory with shape
(dim, num_modes)
.- Returns:
Amps – The bifurcation amplitudes of the modes. The first
num_modes
arrays contain the bifurcation amplitudes of the real parts of the modes; the nextnum_modes
arrays contain those of the imaginary parts.- Return type:
list
- qom.solvers.measure.get_correlation_Pearson(Modes)¶
Method to obtain the Pearson correlation coefficient for two specific modes [6].
\[C_{ij} = \frac{\Sigma_{t} \langle \mathcal{O}_{i} (t) \mathcal{O}_{j} (t) \rangle}{\sqrt{\Sigma_{t} \langle \mathcal{O}_{i}^{2} (t) \rangle} \sqrt{\Sigma_{t} \langle \mathcal{O}_{j}^{2} (t) \rangle}}\]where \(\mathcal{O}_{i}\) and \(\mathcal{O}_{j}\) are the corresponding modes.
- Parameters:
Modes (numpy.ndarray) – The two specific modes with shape
(dim, 2)
.- Returns:
corr_P – Pearson correlation coefficient.
- Return type:
float
- qom.solvers.measure.get_stability_zone(counts)¶
Function to obtain the stability zone given the number of unstable roots.
- Parameters:
counts (list or numpy.ndarray) – Array of number of eigenvalues with positive real parts.
- Returns:
stability_zone –
- Stability zone indicator of the optical steady state. The indicator is calculated in the following pattern:
value
meaning
0
one unstable root.
1
one stable root.
2
three unstable roots.
3
one stable root and two unstable roots.
4
two stable roots and one unstable root.
5
three stable roots.
6
five unstable roots.
7
one stable root and four unstable roots.
8
two stable roots and three unstable root.
9
three stable roots and two unstable root.
10
four stable roots and one unstable root.
11
five stable roots.
- Return type:
int
- qom.solvers.measure.get_system_measures(system, Modes, T=None, params: dict = {}, cb_update=None)¶
Method to obtain the measures from a system method.
- Parameters:
system (
qom.systems.*
) – Instance of the system. Requires predefined system methodget_ivc
and the getter for the system measure.Modes (numpy.ndarray) – Classical modes with shape
(dim, num_modes)
.T (numpy.ndarray, optional) – Times with shape
(dim, )
.params (dict) –
- Parameters for the solver. Available options are:
key
value
’show_progress’
(bool) option to display the progress of the solver. Default is
False
.’system_measure_name’
(str) name of the system measure to calculate. Requires a callable formatted with the prefix
'get_'
and argumentsmodes
,c
andt
. For e.g.,get_A(modes, c, t)
.
cb_update (callable, optional) – Callback function to update status and progress, formatted as
cb_update(status, progress, reset)
, wherestatus
is a string,progress
is a float andreset
is a boolean.
- Returns:
measures – Measures obtained with shape
(dim, )
plus the shape of each measure.- Return type:
numpy.ndarray