QWnet 2.0.0__tar.gz → 2.0.1__tar.gz
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.
- {qwnet-2.0.0 → qwnet-2.0.1}/PKG-INFO +1 -1
- {qwnet-2.0.0 → qwnet-2.0.1}/pyproject.toml +1 -1
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet/__init__.py +5 -13
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet.egg-info/PKG-INFO +1 -1
- {qwnet-2.0.0 → qwnet-2.0.1}/README.md +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/setup.cfg +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet/graphs.py +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet/lattice.py +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet.egg-info/SOURCES.txt +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet.egg-info/dependency_links.txt +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet.egg-info/requires.txt +0 -0
- {qwnet-2.0.0 → qwnet-2.0.1}/src/QWnet.egg-info/top_level.txt +0 -0
|
@@ -12,11 +12,9 @@ def run_simulation(model: str, **kwargs):
|
|
|
12
12
|
'QPageRank' (Quantum PageRank)
|
|
13
13
|
'HadamardQW' (Hadamard Edge Importance)
|
|
14
14
|
'SzegedyQW' (Szegedy Walk)
|
|
15
|
-
'community' (Community Detection)
|
|
16
15
|
'directSumQW' (Direct Sum Quantum Walk)
|
|
17
16
|
**kwargs: Parameters specific to the chosen model.
|
|
18
17
|
"""
|
|
19
|
-
# 处理模型名称(不区分大小写)
|
|
20
18
|
model_upper = model
|
|
21
19
|
|
|
22
20
|
# Lattice Walks
|
|
@@ -46,11 +44,6 @@ def run_simulation(model: str, **kwargs):
|
|
|
46
44
|
initial_type=kwargs.get('initial_type', 'uniform'),
|
|
47
45
|
initial_node=kwargs.get('initial_node'))
|
|
48
46
|
|
|
49
|
-
elif model_upper == 'community':
|
|
50
|
-
return run_community_detection(G=kwargs.get('G'),
|
|
51
|
-
initial_state=kwargs.get('initial_state', 'uniform'),
|
|
52
|
-
coin_type=kwargs.get('coin_type', 'fourier'))
|
|
53
|
-
|
|
54
47
|
elif model_upper == 'QPageRank':
|
|
55
48
|
return run_quantum_pagerank(file_path=kwargs.get('file_path'),
|
|
56
49
|
steps=kwargs.get('steps', 20),
|
|
@@ -62,12 +55,11 @@ def run_simulation(model: str, **kwargs):
|
|
|
62
55
|
top_p=kwargs.get('top_p', 0.05))
|
|
63
56
|
|
|
64
57
|
elif model_upper == 'directSumQW':
|
|
65
|
-
#
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
coin_type=kwargs.get('coin_type', 'fourier'))
|
|
58
|
+
# directSumQW
|
|
59
|
+
return run_community_detection(G=kwargs.get('G'),
|
|
60
|
+
initial_state=kwargs.get('initial_state', 'uniform'),
|
|
61
|
+
coin_type=kwargs.get('coin_type', 'fourier'))
|
|
70
62
|
|
|
71
63
|
else:
|
|
72
|
-
available_models = ['1d', '2d', '3d', 'ChawlaQW', 'QPageRank', 'HadamardQW', 'SzegedyQW', '
|
|
64
|
+
available_models = ['1d', '2d', '3d', 'ChawlaQW', 'QPageRank', 'HadamardQW', 'SzegedyQW', 'directSumQW']
|
|
73
65
|
raise ValueError(f"Unknown model type: {model}. Available: {', '.join(available_models)}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|