Changes between Version 9 and Version 10 of Density


Ignore:
Timestamp:
Dec 3, 2025, 4:56:42 PM (2 weeks ago)
Author:
Durupt
Comment:

Updated the syntax + added a part on the structure of the LHE file <density> tag

Legend:

Unmodified
Added
Removed
Modified
  • Density

    v9 v10  
    2525
    2626== 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:
     27The 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{{{
     29rho = [rho1, rho2, rho3, rho4, rho5, rho6, rho7, rho8, rho9, rho10]
     30}}}
     31
     32
     33Which 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
     39For 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:
    2840
    2941{{{#!python
     
    3648for event in lhe_parser.EventFile(lhe_path):
    3749    density = event.density
    38     square_density = dens.square_matrix(density)
     50    rho_instance = dens.DensityMatrixObservables(density)
     51    square_density = rho_instance.square_matrix()
    3952
    4053}}}
    4154
    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.\\
     55With 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
    4357For the rest of this page, we will use the same import names as in this block of code.
    4458
    45 == Implementation of the quantum information obseravbles
     59
     60== Implementation of the quantum information observables
    4661Now 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.
    4762{{{#!python
    48 concurrence = dens.Get_Concurrence(square_density)
     63concurrence = rho_instance.Get_Concurrence()
    4964}}}
    5065We will now give a list of the different quantum information observables currently available in the library.
     
    5469Purity represents how mixed a quantum system is.\\ Available for all systems \\It can be computed with the following syntax:
    5570{{{#!python
    56 purity = dens.Get_Purity(square_density)
     71purity = rho_instance.Get_Purity()
    5772}}}
    5873Normalised purity (which only differs in the normalisation factor) can be computed with the following syntax:
    5974{{{#!python
    60 purity_normalised = dens.Get_Normalised_Purity(square_density)
     75purity_normalised = rho_instance.Get_Normalised_Purity()
    6176}}}
    6277
     
    6681It can be computed with the following syntax:
    6782{{{#!python
    68 concurrence = dens.Get_Concurrence(square_density)
     83concurrence = rho_instance.Get_Concurrence()
    6984}}}
    7085
    7186For 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:
    7287{{{#!python
    73 lower_bound_concurrence_squared = dens.ConcLB2(square_density, pdg_pos)
    74 upper_bound_concurrence_squared = dens.ConcUB2(square_density, pdg_pos)
     88lower_bound_concurrence_squared = rho_instance.ConcLB2()
     89upper_bound_concurrence_squared = rho_instance.ConcUB2()
    7590}}}
    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 
    7891
    7992=== Bell test
     
    8295It can be computed with the following syntax:
    8396{{{#!python
    84 bell_test, flag_test = dens.Get_Bell_Test(CTC)
     97bell_test, flag_test = rho_instance.Get_Bell_Test()
    8598}}}
    8699where `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`.
     
    91104They can be computed with the following syntax:
    92105{{{#!python
    93 D1, Dn, Dr, Dk, boolD = dens.Get_Dcoef(C)
     106D1, Dn, Dr, Dk, boolD = rho_instance.Get_Dcoef()
    94107}}}
    95108where `C` is the spin-correlation matrix and `D1, Dn, Dr, Dk` are the D coefficients and `boolD` is `True` if the system shows entanglement.
     
    100113They can be computed with the following syntax:
    101114{{{#!python
    102 Ef = dens.Get_Entanglement_Formation(square_density)
     115Ef = rho_instance.Get_Entanglement_Formation()
    103116}}}
    104117
     
    108121They can be computed with the following syntax:
    109122{{{#!python
    110 Magic = dens.Magic_Mixed(square_density, n)
     123Magic = rho_instance.Magic_Mixed()
    111124}}}
    112 where `n` is the number of particles in the density matrix, this has only been tested for `n = 2`.
    113125
    114126=== Negativity
     
    117129It can be computed with the following syntax:
    118130{{{#!python
    119 Negativity, LogNegativity = dens.Negativity(square_density, pdg_pos)
     131Negativity, LogNegativity = rho_instance.Negativity(particle_type)
    120132}}}
    121 where `pdg_pos` is the list of the `PDG` codes in the density matrix.
     133where `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']`.
    122134
    123135=== Mana
     
    126138It can be computed with the following syntax:
    127139{{{#!python
    128 Mana = dens.Get_Mana(square_density, d1, d2)
     140Mana = rho_instance.Get_Mana()
    129141}}}
    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`.
    131142
    132143=== Peres-Horodecki criterion
     
    135146It can be computed with the following syntax:
    136147{{{#!python
    137 flag_entanglement, eigvals = dens.PeresHorodecki_criterion(square_density, pdg_code)
     148flag_entanglement, eigvals = rho_instance.PeresHorodecki_criterion(particle_type)
    138149}}}
    139 where `flag_entanglement` is `True` if the system is entangled and `eigvals` are the eigenvalues.
     150where `flag_entanglement` is `True` if the system is entangled and `eigvals` are the eigenvalues.\\
     151The 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']`.
    140152
    141153=== Trace and fidelity distance
     
    146158fidelity_distance = dens.Fidelity_distance(square_matrix1, square_matrix2)
    147159}}}
    148 
     160In these cases we do not call the instance of the class `DensityMatrixObservables` because it does not depend on a single density matrix.