Trajectree 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trajectree/__init__.py +0 -3
- trajectree/fock_optics/devices.py +1 -1
- trajectree/fock_optics/light_sources.py +2 -2
- trajectree/fock_optics/measurement.py +9 -9
- trajectree/fock_optics/outputs.py +10 -6
- trajectree/fock_optics/utils.py +9 -6
- trajectree/sequence/swap.py +5 -4
- trajectree/trajectory.py +5 -4
- {trajectree-0.0.1.dist-info → trajectree-0.0.3.dist-info}/METADATA +2 -3
- trajectree-0.0.3.dist-info/RECORD +16 -0
- trajectree/quimb/docs/_pygments/_pygments_dark.py +0 -118
- trajectree/quimb/docs/_pygments/_pygments_light.py +0 -118
- trajectree/quimb/docs/conf.py +0 -158
- trajectree/quimb/docs/examples/ex_mpi_expm_evo.py +0 -62
- trajectree/quimb/quimb/__init__.py +0 -507
- trajectree/quimb/quimb/calc.py +0 -1491
- trajectree/quimb/quimb/core.py +0 -2279
- trajectree/quimb/quimb/evo.py +0 -712
- trajectree/quimb/quimb/experimental/__init__.py +0 -0
- trajectree/quimb/quimb/experimental/autojittn.py +0 -129
- trajectree/quimb/quimb/experimental/belief_propagation/__init__.py +0 -109
- trajectree/quimb/quimb/experimental/belief_propagation/bp_common.py +0 -397
- trajectree/quimb/quimb/experimental/belief_propagation/d1bp.py +0 -316
- trajectree/quimb/quimb/experimental/belief_propagation/d2bp.py +0 -653
- trajectree/quimb/quimb/experimental/belief_propagation/hd1bp.py +0 -571
- trajectree/quimb/quimb/experimental/belief_propagation/hv1bp.py +0 -775
- trajectree/quimb/quimb/experimental/belief_propagation/l1bp.py +0 -316
- trajectree/quimb/quimb/experimental/belief_propagation/l2bp.py +0 -537
- trajectree/quimb/quimb/experimental/belief_propagation/regions.py +0 -194
- trajectree/quimb/quimb/experimental/cluster_update.py +0 -286
- trajectree/quimb/quimb/experimental/merabuilder.py +0 -865
- trajectree/quimb/quimb/experimental/operatorbuilder/__init__.py +0 -15
- trajectree/quimb/quimb/experimental/operatorbuilder/operatorbuilder.py +0 -1631
- trajectree/quimb/quimb/experimental/schematic.py +0 -7
- trajectree/quimb/quimb/experimental/tn_marginals.py +0 -130
- trajectree/quimb/quimb/experimental/tnvmc.py +0 -1483
- trajectree/quimb/quimb/gates.py +0 -36
- trajectree/quimb/quimb/gen/__init__.py +0 -2
- trajectree/quimb/quimb/gen/operators.py +0 -1167
- trajectree/quimb/quimb/gen/rand.py +0 -713
- trajectree/quimb/quimb/gen/states.py +0 -479
- trajectree/quimb/quimb/linalg/__init__.py +0 -6
- trajectree/quimb/quimb/linalg/approx_spectral.py +0 -1109
- trajectree/quimb/quimb/linalg/autoblock.py +0 -258
- trajectree/quimb/quimb/linalg/base_linalg.py +0 -719
- trajectree/quimb/quimb/linalg/mpi_launcher.py +0 -397
- trajectree/quimb/quimb/linalg/numpy_linalg.py +0 -244
- trajectree/quimb/quimb/linalg/rand_linalg.py +0 -514
- trajectree/quimb/quimb/linalg/scipy_linalg.py +0 -293
- trajectree/quimb/quimb/linalg/slepc_linalg.py +0 -892
- trajectree/quimb/quimb/schematic.py +0 -1518
- trajectree/quimb/quimb/tensor/__init__.py +0 -401
- trajectree/quimb/quimb/tensor/array_ops.py +0 -610
- trajectree/quimb/quimb/tensor/circuit.py +0 -4824
- trajectree/quimb/quimb/tensor/circuit_gen.py +0 -411
- trajectree/quimb/quimb/tensor/contraction.py +0 -336
- trajectree/quimb/quimb/tensor/decomp.py +0 -1255
- trajectree/quimb/quimb/tensor/drawing.py +0 -1646
- trajectree/quimb/quimb/tensor/fitting.py +0 -385
- trajectree/quimb/quimb/tensor/geometry.py +0 -583
- trajectree/quimb/quimb/tensor/interface.py +0 -114
- trajectree/quimb/quimb/tensor/networking.py +0 -1058
- trajectree/quimb/quimb/tensor/optimize.py +0 -1818
- trajectree/quimb/quimb/tensor/tensor_1d.py +0 -4778
- trajectree/quimb/quimb/tensor/tensor_1d_compress.py +0 -1854
- trajectree/quimb/quimb/tensor/tensor_1d_tebd.py +0 -662
- trajectree/quimb/quimb/tensor/tensor_2d.py +0 -5954
- trajectree/quimb/quimb/tensor/tensor_2d_compress.py +0 -96
- trajectree/quimb/quimb/tensor/tensor_2d_tebd.py +0 -1230
- trajectree/quimb/quimb/tensor/tensor_3d.py +0 -2869
- trajectree/quimb/quimb/tensor/tensor_3d_tebd.py +0 -46
- trajectree/quimb/quimb/tensor/tensor_approx_spectral.py +0 -60
- trajectree/quimb/quimb/tensor/tensor_arbgeom.py +0 -3237
- trajectree/quimb/quimb/tensor/tensor_arbgeom_compress.py +0 -565
- trajectree/quimb/quimb/tensor/tensor_arbgeom_tebd.py +0 -1138
- trajectree/quimb/quimb/tensor/tensor_builder.py +0 -5411
- trajectree/quimb/quimb/tensor/tensor_core.py +0 -11179
- trajectree/quimb/quimb/tensor/tensor_dmrg.py +0 -1472
- trajectree/quimb/quimb/tensor/tensor_mera.py +0 -204
- trajectree/quimb/quimb/utils.py +0 -892
- trajectree/quimb/tests/__init__.py +0 -0
- trajectree/quimb/tests/test_accel.py +0 -501
- trajectree/quimb/tests/test_calc.py +0 -788
- trajectree/quimb/tests/test_core.py +0 -847
- trajectree/quimb/tests/test_evo.py +0 -565
- trajectree/quimb/tests/test_gen/__init__.py +0 -0
- trajectree/quimb/tests/test_gen/test_operators.py +0 -361
- trajectree/quimb/tests/test_gen/test_rand.py +0 -296
- trajectree/quimb/tests/test_gen/test_states.py +0 -261
- trajectree/quimb/tests/test_linalg/__init__.py +0 -0
- trajectree/quimb/tests/test_linalg/test_approx_spectral.py +0 -368
- trajectree/quimb/tests/test_linalg/test_base_linalg.py +0 -351
- trajectree/quimb/tests/test_linalg/test_mpi_linalg.py +0 -127
- trajectree/quimb/tests/test_linalg/test_numpy_linalg.py +0 -84
- trajectree/quimb/tests/test_linalg/test_rand_linalg.py +0 -134
- trajectree/quimb/tests/test_linalg/test_slepc_linalg.py +0 -283
- trajectree/quimb/tests/test_tensor/__init__.py +0 -0
- trajectree/quimb/tests/test_tensor/test_belief_propagation/__init__.py +0 -0
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_d1bp.py +0 -39
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_d2bp.py +0 -67
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_hd1bp.py +0 -64
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_hv1bp.py +0 -51
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_l1bp.py +0 -142
- trajectree/quimb/tests/test_tensor/test_belief_propagation/test_l2bp.py +0 -101
- trajectree/quimb/tests/test_tensor/test_circuit.py +0 -816
- trajectree/quimb/tests/test_tensor/test_contract.py +0 -67
- trajectree/quimb/tests/test_tensor/test_decomp.py +0 -40
- trajectree/quimb/tests/test_tensor/test_mera.py +0 -52
- trajectree/quimb/tests/test_tensor/test_optimizers.py +0 -488
- trajectree/quimb/tests/test_tensor/test_tensor_1d.py +0 -1171
- trajectree/quimb/tests/test_tensor/test_tensor_2d.py +0 -606
- trajectree/quimb/tests/test_tensor/test_tensor_2d_tebd.py +0 -144
- trajectree/quimb/tests/test_tensor/test_tensor_3d.py +0 -123
- trajectree/quimb/tests/test_tensor/test_tensor_arbgeom.py +0 -226
- trajectree/quimb/tests/test_tensor/test_tensor_builder.py +0 -441
- trajectree/quimb/tests/test_tensor/test_tensor_core.py +0 -2066
- trajectree/quimb/tests/test_tensor/test_tensor_dmrg.py +0 -388
- trajectree/quimb/tests/test_tensor/test_tensor_spectral_approx.py +0 -63
- trajectree/quimb/tests/test_tensor/test_tensor_tebd.py +0 -270
- trajectree/quimb/tests/test_utils.py +0 -85
- trajectree-0.0.1.dist-info/RECORD +0 -126
- {trajectree-0.0.1.dist-info → trajectree-0.0.3.dist-info}/WHEEL +0 -0
- {trajectree-0.0.1.dist-info → trajectree-0.0.3.dist-info}/licenses/LICENSE +0 -0
- {trajectree-0.0.1.dist-info → trajectree-0.0.3.dist-info}/top_level.txt +0 -0
trajectree/__init__.py
CHANGED
|
@@ -8,8 +8,8 @@ import numpy as np
|
|
|
8
8
|
from numpy.linalg import matrix_power
|
|
9
9
|
from numpy import kron, sqrt
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
11
|
+
from quimb.tensor.tensor_arbgeom import tensor_network_apply_op_vec #type: ignore
|
|
12
|
+
from quimb.tensor.tensor_1d_compress import enforce_1d_like #type: ignore
|
|
13
13
|
|
|
14
14
|
import qutip as qt
|
|
15
15
|
from math import factorial
|
|
@@ -9,9 +9,9 @@ import numpy as np
|
|
|
9
9
|
from numpy.linalg import matrix_power
|
|
10
10
|
from numpy import sqrt
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
12
|
+
from quimb.tensor import MatrixProductOperator as mpo #type: ignore
|
|
13
|
+
from quimb.tensor.tensor_arbgeom import tensor_network_apply_op_vec #type: ignore
|
|
14
|
+
from quimb.tensor.tensor_1d_compress import enforce_1d_like #type: ignore
|
|
15
15
|
|
|
16
16
|
import qutip as qt
|
|
17
17
|
from math import factorial
|
|
@@ -127,26 +127,26 @@ def bell_state_measurement(psi, N, site_tags, num_modes, efficiencies, dark_coun
|
|
|
127
127
|
if return_MPOs:
|
|
128
128
|
returned_MPOs = [U_BS_H, U_BS_V]
|
|
129
129
|
if use_trajectory:
|
|
130
|
-
quantum_channel_list = [quantum_channel(N = N, num_modes = num_modes, formalism = "closed", unitary_MPOs = BSM_MPO, name = "
|
|
130
|
+
quantum_channel_list = [quantum_channel(N = N, num_modes = num_modes, formalism = "closed", unitary_MPOs = BSM_MPO, name = "beam splitter") for BSM_MPO in returned_MPOs]
|
|
131
131
|
|
|
132
132
|
damping_kraus_ops_0 = single_mode_bosonic_noise_channels(noise_parameter = 1-efficiencies[0], N = N)
|
|
133
133
|
damping_kraus_ops_1 = single_mode_bosonic_noise_channels(noise_parameter = 1-efficiencies[1], N = N)
|
|
134
134
|
two_mode_kraus_ops_0 = [sp.kron(op1, op2) for op1 in damping_kraus_ops_0 for op2 in damping_kraus_ops_0]
|
|
135
135
|
two_mode_kraus_ops_1 = [sp.kron(op1, op2) for op1 in damping_kraus_ops_1 for op2 in damping_kraus_ops_1]
|
|
136
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops_0))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
137
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops_1))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
136
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops_0), name = "detector inefficiency")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
137
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops_1), name = "detector inefficiency")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
138
138
|
|
|
139
139
|
amplification_kraus_ops_0 = single_mode_bosonic_noise_channels(noise_parameter = dark_counts_gain[0], N = N)
|
|
140
140
|
amplification_kraus_ops_1 = single_mode_bosonic_noise_channels(noise_parameter = dark_counts_gain[1], N = N)
|
|
141
141
|
two_mode_kraus_ops_0 = [sp.kron(op1, op2) for op1 in amplification_kraus_ops_0 for op2 in amplification_kraus_ops_0]
|
|
142
142
|
two_mode_kraus_ops_1 = [sp.kron(op1, op2) for op1 in amplification_kraus_ops_1 for op2 in amplification_kraus_ops_1]
|
|
143
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops_0))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
144
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops_1))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
143
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops_0), name = "dark counts")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
144
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops_1), name = "dark counts")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
145
145
|
|
|
146
146
|
BSM_POVM_1_OPs = generate_sqrt_POVM_MPO(sites=measurements[1], outcome = det_outcome, total_sites=num_modes, efficiency=1, N=N, pnr = pnr)
|
|
147
147
|
BSM_POVM_1_OPs.extend(generate_sqrt_POVM_MPO(sites=measurements[0], outcome = 0, total_sites=num_modes, efficiency=1, N=N, pnr = pnr))
|
|
148
148
|
|
|
149
|
-
det_quantum_channels = [quantum_channel(N = N, num_modes = num_modes, formalism = "closed", unitary_MPOs = DET_MPO, name = "
|
|
149
|
+
det_quantum_channels = [quantum_channel(N = N, num_modes = num_modes, formalism = "closed", unitary_MPOs = DET_MPO, name = "Det POVM") for DET_MPO in BSM_POVM_1_OPs]
|
|
150
150
|
quantum_channel_list.extend(det_quantum_channels)
|
|
151
151
|
|
|
152
152
|
return quantum_channel_list
|
|
@@ -20,7 +20,7 @@ def generate_labels(num_systems, N):
|
|
|
20
20
|
labels.append(new_label[:-1])
|
|
21
21
|
return labels
|
|
22
22
|
|
|
23
|
-
def read_quantum_state(TN_state, N, num_states = 4, return_dense = False, precision = 10):
|
|
23
|
+
def read_quantum_state(TN_state, N, num_states = 4, return_dense = False, precision = 10, return_string = False):
|
|
24
24
|
dense_state = TN_state.to_dense()
|
|
25
25
|
if return_dense: return dense_state
|
|
26
26
|
dense_state = np.reshape(dense_state.data, (-1, 1), order = 'C')
|
|
@@ -28,14 +28,18 @@ def read_quantum_state(TN_state, N, num_states = 4, return_dense = False, precis
|
|
|
28
28
|
dense_state.data = np.round(dense_state.data, precision)
|
|
29
29
|
dense_state.eliminate_zeros()
|
|
30
30
|
|
|
31
|
-
print_quantum_state(N, dense_state, num_states)
|
|
31
|
+
return print_quantum_state(N, dense_state, num_states, return_string)
|
|
32
32
|
|
|
33
|
-
def print_quantum_state(N, dense_state, num_states = 4):
|
|
33
|
+
def print_quantum_state(N, dense_state, num_states = 4, return_string = False):
|
|
34
34
|
labels = generate_labels(num_states,N)
|
|
35
35
|
state = dense_state.nonzero()[0]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
output = []
|
|
37
|
+
output.append("Corresponding Basis terms:")
|
|
38
|
+
for k in state: output.append(f"{labels[k]} - {k} - {dense_state[k].data}")
|
|
39
|
+
if not return_string:
|
|
40
|
+
print("\n".join(map(str, output)))
|
|
41
|
+
else:
|
|
42
|
+
return output
|
|
39
43
|
|
|
40
44
|
|
|
41
45
|
def plot_coincidences(coincidence, idler_angles, signal_angles, title = ''):
|
trajectree/fock_optics/utils.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
from numpy import sqrt
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
4
|
+
from quimb.tensor import MatrixProductState as mps #type: ignore
|
|
5
|
+
from quimb.tensor import MatrixProductOperator as mpo #type: ignore
|
|
6
|
+
from quimb.tensor.tensor_arbgeom import tensor_network_apply_op_vec #type: ignore
|
|
7
|
+
from quimb.tensor.tensor_core import new_bond #type: ignore
|
|
8
|
+
from quimb.tensor.tensor_1d_compress import enforce_1d_like #type: ignore
|
|
9
|
+
from quimb.tensor.tensor_1d import TensorNetwork1DOperator #type: ignore
|
|
10
|
+
|
|
11
|
+
from .outputs import read_quantum_state
|
|
10
12
|
|
|
11
13
|
import qutip as qt
|
|
12
14
|
import re
|
|
@@ -154,6 +156,7 @@ def create_bimode_bell_state(bell_state, N, error_tolerance = 1e-12):
|
|
|
154
156
|
elif bell_state == "phi_minus":
|
|
155
157
|
psi = tensor_network_apply_op_vec(NOT_MPO_0, vacuum, compress=True, contract = True, cutoff = error_tolerance)
|
|
156
158
|
|
|
159
|
+
# read_quantum_state(psi, N)
|
|
157
160
|
|
|
158
161
|
psi = tensor_network_apply_op_vec(H_MPO, psi, compress=True, contract = True, cutoff = error_tolerance)
|
|
159
162
|
# read_quantum_state(psi, N, num_states = 2)
|
trajectree/sequence/swap.py
CHANGED
|
@@ -2,6 +2,7 @@ from ..fock_optics.noise_models import *
|
|
|
2
2
|
from ..fock_optics.measurement import *
|
|
3
3
|
from ..fock_optics.utils import *
|
|
4
4
|
from ..fock_optics.light_sources import *
|
|
5
|
+
from ..fock_optics.outputs import *
|
|
5
6
|
|
|
6
7
|
from ..trajectory import *
|
|
7
8
|
|
|
@@ -15,8 +16,8 @@ def generate_swapping_circuit(N, num_modes, site_tags, bsm_det_effs, bsm_dark_co
|
|
|
15
16
|
# Amplitude damping due to fibers
|
|
16
17
|
damping_kraus_ops = single_mode_bosonic_noise_channels(noise_parameter = channel_loss, N = N)
|
|
17
18
|
two_mode_kraus_ops = [sp.kron(op, op) for op in damping_kraus_ops]
|
|
18
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
19
|
-
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops))) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
19
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((2,3), two_mode_kraus_ops), name = "fiber_attenuation")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
20
|
+
quantum_channel_list.append(quantum_channel(N = N, num_modes = num_modes, formalism = "kraus", kraus_ops_tuple = ((6,7), two_mode_kraus_ops), name = "fiber_attenuation")) # The tuples in this list are defined as (sites, kraus_ops). The sites are the sites where the Kraus ops are applied.
|
|
20
21
|
|
|
21
22
|
# Quantum channel for the Bell state measurement
|
|
22
23
|
# BSM_MPOs = bell_state_measurement(None, N, site_tags, num_modes, bsm_det_effs, error_tolerance, measurements = bsm_measurements, pnr = False, use_trajectory = True, return_MPOs = True, compress=True, contract=True)
|
|
@@ -50,7 +51,7 @@ def perform_swapping_simulation(N, num_modes, num_simulations, params, error_tol
|
|
|
50
51
|
quantum_channels = generate_swapping_circuit(N, num_modes, psi.site_tags, [params["BSM_det_loss_1"], params["BSM_det_loss_2"]], [params["BSM_dark_counts_1"], params["BSM_dark_counts_2"]], params["BSM_meas"], params["channel_loss"], error_tolerance)
|
|
51
52
|
|
|
52
53
|
if params["if_analyze_entanglement"]:
|
|
53
|
-
analyze_entanglement(quantum_channels, N, psi.site_tags, num_modes, params["
|
|
54
|
+
analyze_entanglement(quantum_channels, N, psi.site_tags, num_modes, params["PA_det_eff"], error_tolerance, params["alpha_list"], params["delta_list"])
|
|
54
55
|
|
|
55
56
|
t_eval = trajectory_evaluator(quantum_channels)
|
|
56
57
|
|
|
@@ -64,7 +65,7 @@ def perform_swapping_simulation(N, num_modes, num_simulations, params, error_tol
|
|
|
64
65
|
probabilities.append(psi_iter.normalize())
|
|
65
66
|
|
|
66
67
|
if params["calc_fidelity"]:
|
|
67
|
-
fidelity = np.abs(calc_fidelity_swapping(psi_iter, "
|
|
68
|
+
fidelity = np.abs(calc_fidelity_swapping(psi_iter, "psi_plus", N, error_tolerance))
|
|
68
69
|
fidelities.append(fidelity)
|
|
69
70
|
|
|
70
71
|
time_taken = time.time() - start
|
trajectree/trajectory.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import numpy as np
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from quimb.tensor import MatrixProductOperator as mpo #type: ignore
|
|
3
|
+
from quimb.tensor.tensor_arbgeom import tensor_network_apply_op_vec #type: ignore
|
|
4
|
+
from .fock_optics.outputs import read_quantum_state
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class quantum_channel:
|
|
@@ -84,7 +84,7 @@ class trajectory_evaluator():
|
|
|
84
84
|
def cache_trajectree_node(self, trajectory_probs, trajectories):
|
|
85
85
|
sorted_indices = np.argsort(trajectory_probs)
|
|
86
86
|
|
|
87
|
-
print("trajectory_probs", trajectory_probs)
|
|
87
|
+
# print("trajectory_probs", trajectory_probs)
|
|
88
88
|
|
|
89
89
|
cached_trajectory_indices = sorted_indices[-self.cache_size:]
|
|
90
90
|
cached_trajectories = np.array(trajectories)[cached_trajectory_indices]
|
|
@@ -206,5 +206,6 @@ class trajectory_evaluator():
|
|
|
206
206
|
else:
|
|
207
207
|
# print("unitary skipped:", self.traversed_nodes)
|
|
208
208
|
pass
|
|
209
|
+
pass
|
|
209
210
|
|
|
210
211
|
return psi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Trajectree
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Trajectree is a quantum trajectory theory and tensor network based quantum optics simulator.
|
|
5
5
|
Author-email: Ansh Singal <asingal@u.northwestern.edu>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -9,10 +9,9 @@ Classifier: Operating System :: OS Independent
|
|
|
9
9
|
Requires-Python: >=3.9
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: numpy
|
|
13
|
-
Requires-Dist: scipy
|
|
14
12
|
Requires-Dist: matplotlib
|
|
15
13
|
Requires-Dist: qutip
|
|
14
|
+
Requires-Dist: trajectree-quimb
|
|
16
15
|
Dynamic: license-file
|
|
17
16
|
|
|
18
17
|
Trajectree is a quantum trajectory theory and tensor network based quantum optics simulator.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
trajectree/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
trajectree/optical_quant_info.py,sha256=27LWg0jIWT2ZXWVK8HEd-2gqAJl0GzmsyYi7sxyYzvA,7589
|
|
3
|
+
trajectree/trajectory.py,sha256=mKyDZNDRyADouHL4Rf-JU3NYhEynVpUZmZgTl0EZLDE,11332
|
|
4
|
+
trajectree/experimental/sparse.py,sha256=05aFsMcBSCUoBop1LJG_lB5kTULRSYhZhGT9RD-UH4Q,4851
|
|
5
|
+
trajectree/fock_optics/devices.py,sha256=1gwl4AIktqu3obXmNhR1EoKR4iWulP4LfWD4xenKfx8,2130
|
|
6
|
+
trajectree/fock_optics/light_sources.py,sha256=qzBevi1Uqcxb6KuYMuVQ9AkJbHCCigBf21N6s01x-V0,4823
|
|
7
|
+
trajectree/fock_optics/measurement.py,sha256=n5syDcy8i_jYmPzAOV26wDg-Z98X0w_y5MmCBIYn3Gk,13222
|
|
8
|
+
trajectree/fock_optics/noise_models.py,sha256=nyU_jNqjJkkcafq7vIXI8IRDiwthiOr4ZQqf55knZMM,1895
|
|
9
|
+
trajectree/fock_optics/outputs.py,sha256=EMhs2gCwz6giLRyM09zxOLrpdbEuSG9axB4FFw6fuF4,2475
|
|
10
|
+
trajectree/fock_optics/utils.py,sha256=iIz4DUluzpmW_sk1IlBeNYCiWZd6_eTi6I1p93DGt8U,7172
|
|
11
|
+
trajectree/sequence/swap.py,sha256=MNc0E76icEWmaYRLOqXDj2ebEQwC2TlRftZwA8JBQkE,4378
|
|
12
|
+
trajectree-0.0.3.dist-info/licenses/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
13
|
+
trajectree-0.0.3.dist-info/METADATA,sha256=-zp8uGV6M2oHQTUvAcm_2FnXEgzxX6vg_U8bj0HYPMY,611
|
|
14
|
+
trajectree-0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
trajectree-0.0.3.dist-info/top_level.txt,sha256=6x9i8aAZcVn5tZ9J-2IVQMTGdn4bw6DiSd8pR3v4VR8,11
|
|
16
|
+
trajectree-0.0.3.dist-info/RECORD,,
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Pygments version of the sublime Mariana theme.
|
|
4
|
-
|
|
5
|
-
Pygments template by Jan T. Sott (https://github.com/idleberg)
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from pygments.style import Style
|
|
9
|
-
from pygments.token import Keyword, Name, Comment, String, Error, Text, \
|
|
10
|
-
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
BACKGROUND = "#1a1c1e"
|
|
14
|
-
CURRENT_LINE = "#4e5a65"
|
|
15
|
-
SELECTION = "#343d46"
|
|
16
|
-
FOREGROUND = "#d8dee9"
|
|
17
|
-
COMMENT = "#5a6272"
|
|
18
|
-
RED = "#ec5f66"
|
|
19
|
-
ORANGE = "#f9ae58"
|
|
20
|
-
YELLOW = "#fac761"
|
|
21
|
-
GREEN = "#99c794"
|
|
22
|
-
AQUA = "#70c2bb"
|
|
23
|
-
BLUE = "#6699cc"
|
|
24
|
-
PURPLE = "#c695c6"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class MarianaDark(Style):
|
|
28
|
-
|
|
29
|
-
default_style = ''
|
|
30
|
-
|
|
31
|
-
background_color = BACKGROUND
|
|
32
|
-
highlight_color = SELECTION
|
|
33
|
-
|
|
34
|
-
background_color = BACKGROUND
|
|
35
|
-
highlight_color = SELECTION
|
|
36
|
-
|
|
37
|
-
styles = {
|
|
38
|
-
# No corresponding class for the following:
|
|
39
|
-
Text: FOREGROUND, # class: ''
|
|
40
|
-
Whitespace: "", # class: 'w'
|
|
41
|
-
Error: RED, # class: 'err'
|
|
42
|
-
Other: "", # class 'x'
|
|
43
|
-
|
|
44
|
-
Comment: COMMENT, # class: 'c'
|
|
45
|
-
Comment.Multiline: "", # class: 'cm'
|
|
46
|
-
Comment.Preproc: "", # class: 'cp'
|
|
47
|
-
Comment.Single: "", # class: 'c1'
|
|
48
|
-
Comment.Special: "", # class: 'cs'
|
|
49
|
-
|
|
50
|
-
Keyword: PURPLE, # class: 'k'
|
|
51
|
-
Keyword.Constant: RED, # class: 'kc'
|
|
52
|
-
Keyword.Declaration: "", # class: 'kd'
|
|
53
|
-
Keyword.Namespace: PURPLE, # class: 'kn'
|
|
54
|
-
Keyword.Pseudo: RED, # class: 'kp'
|
|
55
|
-
Keyword.Reserved: "", # class: 'kr'
|
|
56
|
-
Keyword.Type: YELLOW, # class: 'kt'
|
|
57
|
-
|
|
58
|
-
Operator: RED, # class: 'o'
|
|
59
|
-
Operator.Word: "", # class: 'ow' - like keywords
|
|
60
|
-
|
|
61
|
-
Punctuation: AQUA, # class: 'p'
|
|
62
|
-
|
|
63
|
-
Name: FOREGROUND, # class: 'n'
|
|
64
|
-
Name.Attribute: BLUE, # class: 'na' - to be revised
|
|
65
|
-
Name.Builtin: BLUE, # class: 'nb'
|
|
66
|
-
Name.Builtin.Pseudo: RED, # class: 'bp'
|
|
67
|
-
Name.Class: ORANGE, # class: 'nc' - to be revised
|
|
68
|
-
Name.Constant: RED, # class: 'no' - to be revised
|
|
69
|
-
Name.Decorator: AQUA, # class: 'nd' - to be revised
|
|
70
|
-
Name.Entity: BLUE, # class: 'ni'
|
|
71
|
-
Name.Exception: RED, # class: 'ne'
|
|
72
|
-
Name.Function: AQUA, # class: 'nf'
|
|
73
|
-
Name.Function.Magic: BLUE, # class: 'nf'
|
|
74
|
-
Name.Property: BLUE, # class: 'py'
|
|
75
|
-
Name.Label: BLUE, # class: 'nl'
|
|
76
|
-
Name.Namespace: BLUE, # class: 'nn' - to be revised
|
|
77
|
-
Name.Other: BLUE, # class: 'nx'
|
|
78
|
-
Name.Tag: AQUA, # class: 'nt' - like a keyword
|
|
79
|
-
Name.Variable: RED, # class: 'nv' - to be revised
|
|
80
|
-
Name.Variable.Class: "", # class: 'vc' - to be revised
|
|
81
|
-
Name.Variable.Global: "", # class: 'vg' - to be revised
|
|
82
|
-
Name.Variable.Instance: "", # class: 'vi' - to be revised
|
|
83
|
-
|
|
84
|
-
Number: ORANGE, # class: 'm'
|
|
85
|
-
Number.Float: "", # class: 'mf'
|
|
86
|
-
Number.Hex: "", # class: 'mh'
|
|
87
|
-
Number.Integer: "", # class: 'mi'
|
|
88
|
-
Number.Integer.Long: "", # class: 'il'
|
|
89
|
-
Number.Oct: "", # class: 'mo'
|
|
90
|
-
|
|
91
|
-
Literal: ORANGE, # class: 'l'
|
|
92
|
-
Literal.Date: GREEN, # class: 'ld'
|
|
93
|
-
|
|
94
|
-
String: GREEN, # class: 's'
|
|
95
|
-
String.Backtick: "", # class: 'sb'
|
|
96
|
-
String.Char: FOREGROUND, # class: 'sc'
|
|
97
|
-
String.Doc: COMMENT, # class: 'sd' - like a comment
|
|
98
|
-
String.Double: "", # class: 's2'
|
|
99
|
-
String.Escape: ORANGE, # class: 'se'
|
|
100
|
-
String.Heredoc: "", # class: 'sh'
|
|
101
|
-
String.Interpol: ORANGE, # class: 'si'
|
|
102
|
-
String.Other: "", # class: 'sx'
|
|
103
|
-
String.Regex: "", # class: 'sr'
|
|
104
|
-
String.Single: "", # class: 's1'
|
|
105
|
-
String.Symbol: "", # class: 'ss'
|
|
106
|
-
|
|
107
|
-
Generic: "", # class: 'g'
|
|
108
|
-
Generic.Deleted: RED, # class: 'gd',
|
|
109
|
-
Generic.Emph: "italic", # class: 'ge'
|
|
110
|
-
Generic.Error: "", # class: 'gr'
|
|
111
|
-
Generic.Heading: "bold " + FOREGROUND, # class: 'gh'
|
|
112
|
-
Generic.Inserted: GREEN, # class: 'gi'
|
|
113
|
-
Generic.Output: "", # class: 'go'
|
|
114
|
-
Generic.Prompt: "bold " + COMMENT, # class: 'gp'
|
|
115
|
-
Generic.Strong: "bold", # class: 'gs'
|
|
116
|
-
Generic.Subheading: "bold " + AQUA, # class: 'gu'
|
|
117
|
-
Generic.Traceback: "", # class: 'gt'
|
|
118
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Pygments (light) version of the sublime Mariana theme.
|
|
4
|
-
|
|
5
|
-
Pygments template by Jan T. Sott (https://github.com/idleberg)
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from pygments.style import Style
|
|
9
|
-
from pygments.token import Keyword, Name, Comment, String, Error, Text, \
|
|
10
|
-
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
BACKGROUND = "#f8f9fb"
|
|
14
|
-
CURRENT_LINE = "#b7c0c8"
|
|
15
|
-
SELECTION = "#d0d6dc"
|
|
16
|
-
FOREGROUND = "#161c27"
|
|
17
|
-
COMMENT = "#8d95a5"
|
|
18
|
-
RED = "#e7323b"
|
|
19
|
-
ORANGE = "#f79626"
|
|
20
|
-
YELLOW = "#f9b52f"
|
|
21
|
-
GREEN = "#70b069"
|
|
22
|
-
AQUA = "#3d8f88"
|
|
23
|
-
BLUE = "#407fbf"
|
|
24
|
-
PURPLE = "#b474b4"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class MarianaLight(Style):
|
|
28
|
-
|
|
29
|
-
default_style = ''
|
|
30
|
-
|
|
31
|
-
background_color = BACKGROUND
|
|
32
|
-
highlight_color = SELECTION
|
|
33
|
-
|
|
34
|
-
background_color = BACKGROUND
|
|
35
|
-
highlight_color = SELECTION
|
|
36
|
-
|
|
37
|
-
styles = {
|
|
38
|
-
# No corresponding class for the following:
|
|
39
|
-
Text: FOREGROUND, # class: ''
|
|
40
|
-
Whitespace: "", # class: 'w'
|
|
41
|
-
Error: RED, # class: 'err'
|
|
42
|
-
Other: "", # class 'x'
|
|
43
|
-
|
|
44
|
-
Comment: COMMENT, # class: 'c'
|
|
45
|
-
Comment.Multiline: "", # class: 'cm'
|
|
46
|
-
Comment.Preproc: "", # class: 'cp'
|
|
47
|
-
Comment.Single: "", # class: 'c1'
|
|
48
|
-
Comment.Special: "", # class: 'cs'
|
|
49
|
-
|
|
50
|
-
Keyword: PURPLE, # class: 'k'
|
|
51
|
-
Keyword.Constant: RED, # class: 'kc'
|
|
52
|
-
Keyword.Declaration: "", # class: 'kd'
|
|
53
|
-
Keyword.Namespace: PURPLE, # class: 'kn'
|
|
54
|
-
Keyword.Pseudo: RED, # class: 'kp'
|
|
55
|
-
Keyword.Reserved: "", # class: 'kr'
|
|
56
|
-
Keyword.Type: YELLOW, # class: 'kt'
|
|
57
|
-
|
|
58
|
-
Operator: RED, # class: 'o'
|
|
59
|
-
Operator.Word: "", # class: 'ow' - like keywords
|
|
60
|
-
|
|
61
|
-
Punctuation: AQUA, # class: 'p'
|
|
62
|
-
|
|
63
|
-
Name: FOREGROUND, # class: 'n'
|
|
64
|
-
Name.Attribute: BLUE, # class: 'na' - to be revised
|
|
65
|
-
Name.Builtin: BLUE, # class: 'nb'
|
|
66
|
-
Name.Builtin.Pseudo: RED, # class: 'bp'
|
|
67
|
-
Name.Class: ORANGE, # class: 'nc' - to be revised
|
|
68
|
-
Name.Constant: RED, # class: 'no' - to be revised
|
|
69
|
-
Name.Decorator: AQUA, # class: 'nd' - to be revised
|
|
70
|
-
Name.Entity: BLUE, # class: 'ni'
|
|
71
|
-
Name.Exception: RED, # class: 'ne'
|
|
72
|
-
Name.Function: AQUA, # class: 'nf'
|
|
73
|
-
Name.Function.Magic: BLUE, # class: 'nf'
|
|
74
|
-
Name.Property: BLUE, # class: 'py'
|
|
75
|
-
Name.Label: BLUE, # class: 'nl'
|
|
76
|
-
Name.Namespace: BLUE, # class: 'nn' - to be revised
|
|
77
|
-
Name.Other: BLUE, # class: 'nx'
|
|
78
|
-
Name.Tag: AQUA, # class: 'nt' - like a keyword
|
|
79
|
-
Name.Variable: RED, # class: 'nv' - to be revised
|
|
80
|
-
Name.Variable.Class: "", # class: 'vc' - to be revised
|
|
81
|
-
Name.Variable.Global: "", # class: 'vg' - to be revised
|
|
82
|
-
Name.Variable.Instance: "", # class: 'vi' - to be revised
|
|
83
|
-
|
|
84
|
-
Number: ORANGE, # class: 'm'
|
|
85
|
-
Number.Float: "", # class: 'mf'
|
|
86
|
-
Number.Hex: "", # class: 'mh'
|
|
87
|
-
Number.Integer: "", # class: 'mi'
|
|
88
|
-
Number.Integer.Long: "", # class: 'il'
|
|
89
|
-
Number.Oct: "", # class: 'mo'
|
|
90
|
-
|
|
91
|
-
Literal: ORANGE, # class: 'l'
|
|
92
|
-
Literal.Date: GREEN, # class: 'ld'
|
|
93
|
-
|
|
94
|
-
String: GREEN, # class: 's'
|
|
95
|
-
String.Backtick: "", # class: 'sb'
|
|
96
|
-
String.Char: FOREGROUND, # class: 'sc'
|
|
97
|
-
String.Doc: COMMENT, # class: 'sd' - like a comment
|
|
98
|
-
String.Double: "", # class: 's2'
|
|
99
|
-
String.Escape: ORANGE, # class: 'se'
|
|
100
|
-
String.Heredoc: "", # class: 'sh'
|
|
101
|
-
String.Interpol: ORANGE, # class: 'si'
|
|
102
|
-
String.Other: "", # class: 'sx'
|
|
103
|
-
String.Regex: "", # class: 'sr'
|
|
104
|
-
String.Single: "", # class: 's1'
|
|
105
|
-
String.Symbol: "", # class: 'ss'
|
|
106
|
-
|
|
107
|
-
Generic: "", # class: 'g'
|
|
108
|
-
Generic.Deleted: RED, # class: 'gd',
|
|
109
|
-
Generic.Emph: "italic", # class: 'ge'
|
|
110
|
-
Generic.Error: "", # class: 'gr'
|
|
111
|
-
Generic.Heading: "bold " + FOREGROUND, # class: 'gh'
|
|
112
|
-
Generic.Inserted: GREEN, # class: 'gi'
|
|
113
|
-
Generic.Output: "", # class: 'go'
|
|
114
|
-
Generic.Prompt: "bold " + COMMENT, # class: 'gp'
|
|
115
|
-
Generic.Strong: "bold", # class: 'gs'
|
|
116
|
-
Generic.Subheading: "bold " + AQUA, # class: 'gu'
|
|
117
|
-
Generic.Traceback: "", # class: 'gt'
|
|
118
|
-
}
|
trajectree/quimb/docs/conf.py
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# Configuration file for the Sphinx documentation builder.
|
|
2
|
-
#
|
|
3
|
-
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
-
|
|
6
|
-
import os
|
|
7
|
-
import sys
|
|
8
|
-
sys.path.append(os.path.abspath("./_pygments"))
|
|
9
|
-
|
|
10
|
-
# -- Project information -----------------------------------------------------
|
|
11
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
12
|
-
|
|
13
|
-
project = 'quimb'
|
|
14
|
-
copyright = '2015-2024, Johnnie Gray'
|
|
15
|
-
author = 'Johnnie Gray'
|
|
16
|
-
|
|
17
|
-
# The full version, including alpha/beta/rc tags
|
|
18
|
-
try:
|
|
19
|
-
from quimb import __version__
|
|
20
|
-
release = __version__
|
|
21
|
-
except ImportError:
|
|
22
|
-
try:
|
|
23
|
-
from importlib.metadata import version as _version
|
|
24
|
-
release = _version('quimb')
|
|
25
|
-
except ImportError:
|
|
26
|
-
release = '0.0.0+unknown'
|
|
27
|
-
|
|
28
|
-
version = '.'.join(release.split('.')[:2])
|
|
29
|
-
|
|
30
|
-
# -- General configuration ---------------------------------------------------
|
|
31
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
32
|
-
|
|
33
|
-
extensions = [
|
|
34
|
-
'sphinx.ext.intersphinx',
|
|
35
|
-
'sphinx.ext.extlinks',
|
|
36
|
-
'sphinx.ext.napoleon',
|
|
37
|
-
'sphinx.ext.linkcode',
|
|
38
|
-
'myst_nb',
|
|
39
|
-
"sphinx_design",
|
|
40
|
-
'sphinx_copybutton',
|
|
41
|
-
'autoapi.extension',
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
# msyt_nb configuration
|
|
45
|
-
nb_execution_mode = "off"
|
|
46
|
-
myst_heading_anchors = 4
|
|
47
|
-
myst_enable_extensions = [
|
|
48
|
-
"amsmath",
|
|
49
|
-
"colon_fence",
|
|
50
|
-
"deflist",
|
|
51
|
-
"dollarmath",
|
|
52
|
-
"html_image",
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# sphinx-autoapi
|
|
57
|
-
autoapi_dirs = ['../quimb']
|
|
58
|
-
|
|
59
|
-
extlinks = {
|
|
60
|
-
'issue': ('https://github.com/jcmgray/quimb/issues/%s', 'GH %s'),
|
|
61
|
-
'pull': ('https://github.com/jcmgray/quimb/pull/%s', 'PR %s'),
|
|
62
|
-
}
|
|
63
|
-
intersphinx_mapping = {
|
|
64
|
-
'python': ('https://docs.python.org/3/', None),
|
|
65
|
-
'numpy': ('https://numpy.org/doc/stable/', None),
|
|
66
|
-
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
|
|
67
|
-
'cotengra': ('https://cotengra.readthedocs.io/en/latest/', None),
|
|
68
|
-
'autoray': ('https://autoray.readthedocs.io/en/latest/', None),
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# Add any paths that contain templates here, relative to this directory.
|
|
72
|
-
templates_path = ['_templates']
|
|
73
|
-
|
|
74
|
-
# List of patterns, relative to source directory, that match files and
|
|
75
|
-
# directories to ignore when looking for source files.
|
|
76
|
-
# This pattern also affects html_static_path and html_extra_path.
|
|
77
|
-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
|
|
78
|
-
|
|
79
|
-
# -- Options for HTML output -------------------------------------------------
|
|
80
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
81
|
-
|
|
82
|
-
html_theme = 'furo'
|
|
83
|
-
html_theme_options = {
|
|
84
|
-
"sidebar_hide_name": True,
|
|
85
|
-
"light_css_variables": {
|
|
86
|
-
# "color-brand-primary": "hsl(45, 80%, 45%)",
|
|
87
|
-
"color-brand-primary": "hsl(210, 50%, 50%)",
|
|
88
|
-
"color-brand-content": "hsl(210, 50%, 50%)",
|
|
89
|
-
},
|
|
90
|
-
"dark_css_variables": {
|
|
91
|
-
"color-brand-primary": "hsl(210, 50%, 60%)",
|
|
92
|
-
"color-brand-content": "hsl(210, 50%, 60%)",
|
|
93
|
-
},
|
|
94
|
-
"light_logo": "quimb_logo_title.png",
|
|
95
|
-
"dark_logo": "quimb_logo_title.png",
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
pygments_style = '_pygments_light.MarianaLight'
|
|
99
|
-
pygments_dark_style = "_pygments_dark.MarianaDark"
|
|
100
|
-
|
|
101
|
-
html_static_path = ['_static']
|
|
102
|
-
html_css_files = ["my-styles.css"]
|
|
103
|
-
html_favicon = "_static/quimb.ico"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def linkcode_resolve(domain, info):
|
|
107
|
-
"""
|
|
108
|
-
Determine the URL corresponding to Python object
|
|
109
|
-
"""
|
|
110
|
-
import quimb
|
|
111
|
-
import inspect
|
|
112
|
-
|
|
113
|
-
if domain != "py":
|
|
114
|
-
return None
|
|
115
|
-
|
|
116
|
-
modname = info["module"]
|
|
117
|
-
fullname = info["fullname"]
|
|
118
|
-
|
|
119
|
-
submod = sys.modules.get(modname)
|
|
120
|
-
if submod is None:
|
|
121
|
-
return None
|
|
122
|
-
|
|
123
|
-
obj = submod
|
|
124
|
-
for part in fullname.split("."):
|
|
125
|
-
try:
|
|
126
|
-
obj = getattr(obj, part)
|
|
127
|
-
except AttributeError:
|
|
128
|
-
return None
|
|
129
|
-
|
|
130
|
-
try:
|
|
131
|
-
fn = inspect.getsourcefile(inspect.unwrap(obj))
|
|
132
|
-
except TypeError:
|
|
133
|
-
fn = None
|
|
134
|
-
if not fn:
|
|
135
|
-
return None
|
|
136
|
-
|
|
137
|
-
try:
|
|
138
|
-
source, lineno = inspect.getsourcelines(obj)
|
|
139
|
-
except OSError:
|
|
140
|
-
lineno = None
|
|
141
|
-
|
|
142
|
-
if lineno:
|
|
143
|
-
linespec = f"#L{lineno}-L{lineno + len(source) - 1}"
|
|
144
|
-
else:
|
|
145
|
-
linespec = ""
|
|
146
|
-
|
|
147
|
-
fn = os.path.relpath(fn, start=os.path.dirname(quimb.__file__))
|
|
148
|
-
|
|
149
|
-
if "+" in quimb.__version__:
|
|
150
|
-
return (
|
|
151
|
-
f"https://github.com/jcmgray/quimb/blob/"
|
|
152
|
-
f"main/quimb/{fn}{linespec}"
|
|
153
|
-
)
|
|
154
|
-
else:
|
|
155
|
-
return (
|
|
156
|
-
f"https://github.com/jcmgray/quimb/blob/"
|
|
157
|
-
f"v{quimb.__version__}/quimb/{fn}{linespec}"
|
|
158
|
-
)
|