-
Notifications
You must be signed in to change notification settings - Fork 7
/
Example_gaussian_state.py
56 lines (31 loc) · 1.21 KB
/
Example_gaussian_state.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""
Example of usage of the gaussian_state class
Github: https://github.com/IgorBrandao42/Gaussian-Quantum-Information-Numerical-Toolbox-python
Author: Igor Brandão
Contact: igorbrandao@aluno.puc-rio.br
"""
import numpy as np
from quantum_gaussian_toolbox import *
# Creation of many different state
thermal = gaussian_state("thermal", 100)
squeezed = gaussian_state("squeezed", 1.2)
squeezed.displace(2 + 5j)
coherent = gaussian_state("coherent", 2+1j);
coherent.rotate(np.pi/6)
bipartite = squeezed.tensor_product([thermal])
bipartite.two_mode_squeezing(1.5)
partition = bipartite.partial_trace([1])
tripartite = thermal.tensor_product([squeezed, coherent])
bipartition = tripartite.only_modes([0,2])
# Retrieval of information from the gaussian states
lambda_thermal = thermal.symplectic_eigenvalues()
lambda_tri = tripartite.symplectic_eigenvalues()
p_tri = tripartite.purity()
p_coherent = coherent.purity()
S = thermal.von_Neumann_Entropy()
I = tripartite.mutual_information()
nbar_th = thermal.occupation_number()
nbar_3 = tripartite.occupation_number()
F_ac = coherent.fidelity(squeezed)
C_squeezed = squeezed.coherence()