Changes between Version 9 and Version 10 of Density
- Timestamp:
- Dec 3, 2025, 4:56:42 PM (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Density
v9 v10 25 25 26 26 == How to read the density matrices in the LHE file 27 The LHE file can be read with the parser lhe_parser.py available in MadGraph. An example of code that would parse the density matrix value for each event is: 27 The density matrices are stored in a short format (only the independent parameters are written, using the fact that it is hermitian) to save space in the LHE file. These coefficients are the triangular inferior part of the density matrix. For example a `4x4` density matrix is writen as 28 {{{ 29 rho = [rho1, rho2, rho3, rho4, rho5, rho6, rho7, rho8, rho9, rho10] 30 }}} 31 32 33 Which corresponds to the following coefficients in the usual density matrix square `4x4` structure: 34 ||rho1||rho2*||rho3*||rho4*|| 35 ||rho2||rho5||rho6*||rho7*|| 36 ||rho3||rho6||rho8||rho9*|| 37 ||rho4||rho7||rho9||rho10|| 38 39 For additional analyses, the density matrices can be extracted from the LHE file with a parser, for instance `lhe_parser.py` available in MadGraph. An example of code that would parse the density matrix value for each event is: 28 40 29 41 {{{#!python … … 36 48 for event in lhe_parser.EventFile(lhe_path): 37 49 density = event.density 38 square_density = dens.square_matrix(density) 50 rho_instance = dens.DensityMatrixObservables(density) 51 square_density = rho_instance.square_matrix() 39 52 40 53 }}} 41 54 42 With this code, for each event of the file, you read the value `density` which contains the independent coefficients of the density matrix. The utility function `square_matrix` allows to write it in the usual matrix form needed for further analysis.\\ 55 With this code, for each event of the file, you read the value `density` which contains the independent coefficients of the density matrix. With this value of the density matrix, the class `DensityMatrixObservables` is instanciated. Different kind of observables and utility method are given to simplify analyses. For instance the method `square_matrix` transforms the density matrix in the usual square form that is easier to read.\\ 56 43 57 For the rest of this page, we will use the same import names as in this block of code. 44 58 45 == Implementation of the quantum information obseravbles 59 60 == Implementation of the quantum information observables 46 61 Now that we have the density matrices for each event, we can compute any quantum information observable that we want. The library `Density_functions.py` contains a non-exaustive list of them that will be listed here and that can be called (example of the concurrence here) via. 47 62 {{{#!python 48 concurrence = dens.Get_Concurrence(square_density)63 concurrence = rho_instance.Get_Concurrence() 49 64 }}} 50 65 We will now give a list of the different quantum information observables currently available in the library. … … 54 69 Purity represents how mixed a quantum system is.\\ Available for all systems \\It can be computed with the following syntax: 55 70 {{{#!python 56 purity = dens.Get_Purity(square_density)71 purity = rho_instance.Get_Purity() 57 72 }}} 58 73 Normalised purity (which only differs in the normalisation factor) can be computed with the following syntax: 59 74 {{{#!python 60 purity_normalised = dens.Get_Normalised_Purity(square_density)75 purity_normalised = rho_instance.Get_Normalised_Purity() 61 76 }}} 62 77 … … 66 81 It can be computed with the following syntax: 67 82 {{{#!python 68 concurrence = dens.Get_Concurrence(square_density)83 concurrence = rho_instance.Get_Concurrence() 69 84 }}} 70 85 71 86 For the qutrit-qutrit (3 x 3) system, lower and upper bounds (the square of these bounds are computed more precisely) are known and be computer with the following syntax: 72 87 {{{#!python 73 lower_bound_concurrence_squared = dens.ConcLB2(square_density, pdg_pos)74 upper_bound_concurrence_squared = dens.ConcUB2(square_density, pdg_pos)88 lower_bound_concurrence_squared = rho_instance.ConcLB2() 89 upper_bound_concurrence_squared = rho_instance.ConcUB2() 75 90 }}} 76 Note that `pdg_pos` is a the list of the `PDG` codes of the particles in the density matrix. If you study a system W^+^ W^-^, we would have `pdg_pos = [24, -24]`77 78 91 79 92 === Bell test … … 82 95 It can be computed with the following syntax: 83 96 {{{#!python 84 bell_test, flag_test = dens.Get_Bell_Test(CTC)97 bell_test, flag_test = rho_instance.Get_Bell_Test() 85 98 }}} 86 99 where `CTC` is the product of the transposed spin correlation matrix with the spin correlation matrix and `flag_test` is a boolean being `True` if `\lambda_1 + \lambda_2 > 1`. … … 91 104 They can be computed with the following syntax: 92 105 {{{#!python 93 D1, Dn, Dr, Dk, boolD = dens.Get_Dcoef(C)106 D1, Dn, Dr, Dk, boolD = rho_instance.Get_Dcoef() 94 107 }}} 95 108 where `C` is the spin-correlation matrix and `D1, Dn, Dr, Dk` are the D coefficients and `boolD` is `True` if the system shows entanglement. … … 100 113 They can be computed with the following syntax: 101 114 {{{#!python 102 Ef = dens.Get_Entanglement_Formation(square_density)115 Ef = rho_instance.Get_Entanglement_Formation() 103 116 }}} 104 117 … … 108 121 They can be computed with the following syntax: 109 122 {{{#!python 110 Magic = dens.Magic_Mixed(square_density, n)123 Magic = rho_instance.Magic_Mixed() 111 124 }}} 112 where `n` is the number of particles in the density matrix, this has only been tested for `n = 2`.113 125 114 126 === Negativity … … 117 129 It can be computed with the following syntax: 118 130 {{{#!python 119 Negativity, LogNegativity = dens.Negativity(square_density, pdg_pos)131 Negativity, LogNegativity = rho_instance.Negativity(particle_type) 120 132 }}} 121 where `p dg_pos` is the list of the `PDG` codes in the density matrix.133 where `particle_type` is the list of strings defining which type of particles are in the density matrix. For instance if the system is `2x3`, one would have `particle_type = ['fermion', 'boson']`. 122 134 123 135 === Mana … … 126 138 It can be computed with the following syntax: 127 139 {{{#!python 128 Mana = dens.Get_Mana(square_density, d1, d2)140 Mana = rho_instance.Get_Mana() 129 141 }}} 130 where `d1` and `d2` are the dimensions of the Hilbert space on which each of the two particles in the density matrix are defined. Usually we have `d1 = 3 = d2`.131 142 132 143 === Peres-Horodecki criterion … … 135 146 It can be computed with the following syntax: 136 147 {{{#!python 137 flag_entanglement, eigvals = dens.PeresHorodecki_criterion(square_density, pdg_code)148 flag_entanglement, eigvals = rho_instance.PeresHorodecki_criterion(particle_type) 138 149 }}} 139 where `flag_entanglement` is `True` if the system is entangled and `eigvals` are the eigenvalues. 150 where `flag_entanglement` is `True` if the system is entangled and `eigvals` are the eigenvalues.\\ 151 The input `particle_type` is the list of strings defining which type of particles are in the density matrix. For instance if the system is `2x3`, one would have `particle_type = ['fermion', 'boson']`. 140 152 141 153 === Trace and fidelity distance … … 146 158 fidelity_distance = dens.Fidelity_distance(square_matrix1, square_matrix2) 147 159 }}} 148 160 In these cases we do not call the instance of the class `DensityMatrixObservables` because it does not depend on a single density matrix.
