lightsolver-lib 0.3.0__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.
@@ -0,0 +1,16 @@
1
+ from .lightsolver_lib import calc_ising_energies
2
+ from .lightsolver_lib import probmat_qubo_to_ising
3
+ from .lightsolver_lib import probmat_ising_to_qubo
4
+ from .lightsolver_lib import create_random_initial_states
5
+ from .lightsolver_lib import calc_ising_energy_from_states
6
+ from .lightsolver_lib import XYModelParams
7
+ from .lightsolver_lib import coupling_matrix_xy
8
+
9
+ __all__ = ['calc_ising_energies',
10
+ 'probmat_qubo_to_ising',
11
+ 'probmat_ising_to_qubo',
12
+ 'create_random_initial_states',
13
+ 'calc_ising_energy_from_states',
14
+ 'XYModelParams',
15
+ 'coupling_matrix_xy',
16
+ ]
@@ -0,0 +1,306 @@
1
+ import numpy
2
+
3
+ def calc_ising_energies(problem_mat_ising: numpy.ndarray, states_ising: numpy.ndarray) -> numpy.ndarray:
4
+ """
5
+ ### Calculate the energies of a given Ising model and spins
6
+
7
+ ## Parameters:
8
+ - `problem_mat_ising` - numpy.array of size NxN representing the Ising problem with the external filed on the diagonal (N - Number of spins)
9
+ - `states_ising` - numpy.array of the spins of size N * n_states
10
+
11
+ ## Returns:
12
+ - `energies` - numpy.array of size [other dimnsions]
13
+ """
14
+
15
+ n_spins = states_ising.shape[0]
16
+ assert problem_mat_ising.shape[0] == n_spins, "Row count of states_ising must match the number of spins"
17
+
18
+ # To handle single states correctly.
19
+ if states_ising.ndim == 1:
20
+ states_ising.shape = (n_spins, 1)
21
+
22
+ h = numpy.diag(problem_mat_ising)
23
+ J = problem_mat_ising - numpy.diag(h)
24
+
25
+ h.shape = (n_spins, 1)
26
+
27
+ # Sum over the spin axis, which is always second from last.
28
+ energies = numpy.sum(h * states_ising + states_ising * (J @ states_ising), -2)
29
+
30
+ # Flip the axis back for 3D case.
31
+ if energies.ndim == 2:
32
+ energies = numpy.transpose(energies)
33
+
34
+ return energies
35
+
36
+ def probmat_qubo_to_ising(problem_mat_qubo: numpy.ndarray) -> numpy.ndarray:
37
+ """
38
+ ### Converts a QUBO problem to the equivalent Ising problem.
39
+
40
+ ## Parameters:
41
+ - `problem_mat_qubo` - A symmetric real-valued NxN matrix representing a QUBO problem
42
+
43
+ ## Returns:
44
+ - `problem_mat_ising` - A matrix of size NxN representing the ising problem with the linear part on its diagonal
45
+ - `ising_offset` - The energy offset between the problems
46
+ """
47
+ n_spins = problem_mat_qubo.shape[0]
48
+
49
+ # Off diagonal elements
50
+ problem_mat_ising = 0.25 * problem_mat_qubo
51
+
52
+ # Diagonal elements
53
+ col_sum = numpy.sum(problem_mat_qubo, axis=0)
54
+ problem_mat_ising[numpy.diag_indices(n_spins)] = 0.5 * col_sum
55
+
56
+ # Offset
57
+ diag_sum = numpy.sum(numpy.diag(problem_mat_qubo))
58
+ linear_offset = 0.5 * diag_sum
59
+ quad_offset = 0.25 * problem_mat_qubo.sum() - 0.25 * diag_sum
60
+
61
+ ising_offset = linear_offset + quad_offset
62
+ return problem_mat_ising, ising_offset
63
+
64
+ def probmat_ising_to_qubo(problem_mat_ising: numpy.ndarray) -> numpy.ndarray:
65
+ """
66
+ ### Converts an Ising problem to the equivalent QUBO problem.
67
+
68
+ ## Parameters:
69
+ - `problem_mat_ising` - The symmetric real-valued NxN matrix representing the Ising problem, with the linear part on its diagonal
70
+
71
+ ## Returns:
72
+ - `problem_mat_qubo` - The NxN QUBO matrix representing the problem
73
+ - `offset` - The energy offset between the problems
74
+ """
75
+ n_spins = problem_mat_ising.shape[0]
76
+ h = numpy.diag(problem_mat_ising)
77
+ J = problem_mat_ising - numpy.diag(h)
78
+ col_sum = numpy.sum(J, axis=0)
79
+
80
+ # Off-diagonal elements
81
+ problem_mat_qubo = 4 * J
82
+
83
+ # Diagonal elements
84
+ problem_mat_qubo[numpy.diag_indices(n_spins)] = -4 * col_sum + 2 * h
85
+
86
+ # Offset
87
+ offset = numpy.sum(J) - numpy.sum(h)
88
+
89
+ return problem_mat_qubo, offset
90
+
91
+ def create_random_initial_states(num_lasers: int, num_states: int, radius_scale_factor: float = 1, seed: int = -1) -> numpy.ndarray:
92
+ """
93
+ ### Creates an array of initial states of size num_lasers * num_states
94
+
95
+ ## Parameters:
96
+ - `num_lasers` - Number of lasers
97
+ - `num_states ` - Number of initial states
98
+ - `radius_scale_factor` - The amplitude scale of the states
99
+ - `seed` - Seed for reproducibility. -1 - randpm seed
100
+
101
+ ## Returns:
102
+ - `init_states` - Numpy array of size num_lasers * num_states represensting random laser states
103
+ """
104
+ if seed >= 0:
105
+ rng = numpy.random.default_rng(seed=seed)
106
+ phases = rng.random((num_lasers, num_states))
107
+ amplitudes = radius_scale_factor * rng.random((num_lasers, num_states))
108
+ else:
109
+ phases = numpy.random.rand(num_lasers, num_states)
110
+ amplitudes = radius_scale_factor * numpy.random.rand(num_lasers, num_states)
111
+ init_states = amplitudes * numpy.exp(2j * numpy.pi * phases)
112
+ return init_states
113
+
114
+ def best_energy_search_xy(state: numpy.ndarray, probmat_ising: numpy.ndarray) -> tuple[numpy.ndarray, float]:
115
+ """
116
+ ### Find the best assignment of spin values (+-1) to lasers, in terms of minimal Ising energy.
117
+
118
+ ## Parameters:
119
+ - `state` - numpy.ndarray of size (N, ) representing the lasers' state (N - Number of lasers)
120
+ - `probmat` - numpy.ndarray of size NxN representing the Ising problem with the external field on the diagonal
121
+
122
+ ## Returns:
123
+ - `best_state_ising` - Ising state with the minimal Ising energy
124
+ - `best_energy` - Energy of the best state
125
+ """
126
+ is_single_state = len(state.shape) == 1
127
+ # if is_single_state:
128
+ # state = state.reshape(-1, 1)
129
+
130
+ n_lasers = state.shape[0]
131
+ n_states = 1 if is_single_state else state.shape[1]
132
+
133
+ # Without external field
134
+ if n_lasers == probmat_ising.shape[0]:
135
+ state = state / numpy.abs(state)
136
+
137
+ idx_states = range(n_states)
138
+
139
+ # Initialize best state (division relative to the x axis)
140
+ theta = numpy.angle(state) % (2 * numpy.pi)
141
+ is_above_x_axis = numpy.logical_and(theta <= numpy.pi, theta > 0)
142
+ best_state_temp = numpy.zeros_like(state, dtype=numpy.int32)
143
+ best_state_temp[is_above_x_axis] = -2
144
+ best_state_temp = best_state_temp + 1
145
+
146
+ temp = numpy.sign(numpy.imag(state)) * numpy.real(state)
147
+ ind_sort = numpy.argsort(temp, axis=0)
148
+
149
+ # Off diagonal elements
150
+ J = probmat_ising.copy()
151
+ numpy.fill_diagonal(J, 0)
152
+
153
+ # External field
154
+ h = numpy.diag(probmat_ising)
155
+
156
+ energy_diff = numpy.zeros((2 * n_lasers, n_states))
157
+ energy_diff[0, :] = calc_ising_energies(probmat_ising, best_state_temp)
158
+
159
+ for i, k in zip(reversed(range(1, 2 * n_lasers)), range(1, 2 * n_lasers)):
160
+ # Flip current spin sign for each state
161
+ rows_to_flip = [ind_sort[i % n_lasers, idx_state] for idx_state in idx_states]
162
+ best_state_temp[rows_to_flip, idx_states] = -1 * best_state_temp[rows_to_flip, idx_states]
163
+
164
+ # Calc energy difference caused by the flip
165
+ energy_diff[k, :] = 4 * (J[rows_to_flip] * best_state_temp.T).sum(axis=1) * best_state_temp[rows_to_flip, idx_states] \
166
+ + 2 * h[rows_to_flip] * best_state_temp[rows_to_flip, idx_states]
167
+
168
+ energy_cumsum = numpy.cumsum(energy_diff, axis=0)
169
+ idx_min_energy = numpy.argmin(energy_cumsum, axis=0)
170
+
171
+ # Reflip to get best state
172
+ for s in idx_states:
173
+ for i in range(1, 2 * n_lasers - idx_min_energy[s]):
174
+ best_state_temp[ind_sort[i % n_lasers, s], s] = -1 * best_state_temp[ind_sort[i % n_lasers, s], s]
175
+
176
+ # With external field
177
+ elif len(state) == probmat_ising.shape[0] + 1:
178
+ n_lasers = n_lasers - 1
179
+ state = state / numpy.abs(state)
180
+ state = state / state[0]
181
+
182
+ idx_states = range(n_states)
183
+
184
+ # Initialize best state (division relative to the x axis)
185
+ theta = numpy.angle(state[1:]) % (2 * numpy.pi)
186
+ is_above_x_axis = numpy.logical_and(theta <= numpy.pi, theta > 0)
187
+ best_state_temp = numpy.zeros_like(state[1:], dtype=numpy.int32)
188
+ best_state_temp[is_above_x_axis] = -2
189
+ best_state_temp = best_state_temp + 1
190
+
191
+ # to order them all along the projected imaginary axis
192
+
193
+ temp = numpy.sign(numpy.imag(state[1:])) * numpy.real(state[1:])
194
+ ind_sort = numpy.argsort(temp, axis=0)
195
+
196
+ # Off diagonal elements
197
+ J = probmat_ising.copy()
198
+ numpy.fill_diagonal(J, 0)
199
+
200
+ # External field
201
+ h = numpy.diag(probmat_ising)
202
+
203
+ energy_diff = numpy.zeros((2 * n_lasers, n_states))
204
+ energy_diff[0, :] = calc_ising_energies(probmat_ising, best_state_temp)
205
+
206
+ for i, k in zip(reversed(range(1, 2 * n_lasers)), range(1, 2 * n_lasers)):
207
+ # Flip current spin sign for each state
208
+ rows_to_flip = [ind_sort[i % n_lasers, idx_state] for idx_state in idx_states]
209
+ best_state_temp[rows_to_flip, idx_states] = -1 * best_state_temp[rows_to_flip, idx_states]
210
+
211
+ # Calc energy difference caused by the flip
212
+ energy_diff[k, :] = 4 * (J[rows_to_flip] * best_state_temp.T).sum(axis=1) * best_state_temp[rows_to_flip, idx_states] \
213
+ + 2 * h[rows_to_flip] * best_state_temp[rows_to_flip, idx_states]
214
+
215
+ energy_cumsum = numpy.cumsum(energy_diff, axis=0)
216
+ idx_min_energy = numpy.argmin(energy_cumsum, axis=0)
217
+
218
+ # Reflip to get best state
219
+ for s in idx_states:
220
+ for i in range(1, 2 * n_lasers - idx_min_energy[s]):
221
+ best_state_temp[ind_sort[i % n_lasers, s], s] = -1 * best_state_temp[ind_sort[i % n_lasers, s], s]
222
+
223
+ else:
224
+ print("state and probmat do not match in dimensions")
225
+
226
+ best_energy = numpy.min(energy_cumsum, axis=0)
227
+ return best_state_temp, best_energy
228
+
229
+ def calc_ising_energy_from_states(probmat_ising: numpy.ndarray, states: numpy.ndarray) -> numpy.ndarray:
230
+ """
231
+ ### Calculate the energies of a given Ising model and phasor states
232
+
233
+ ## Parameters:
234
+ - `probmat_ising` - numpy.ndarray of size N*N representing the Ising problem (N - Number of lasers)
235
+ - `states` - numpy.ndarray of the laser states of size N * n_states
236
+
237
+ ## Returns:
238
+ - `states_ising` - numpy.array of size (N, n_states) consisting of the Ising states with the best energy
239
+ - `energy` - numpy.array of size (n_states, ) consisting of the best Ising energy for each state
240
+ """
241
+ if len(states.shape) == 1:
242
+ states = states.reshape(-1, 1)
243
+
244
+ n_states = states.shape[1]
245
+
246
+ # Find state with best energy for each of the states
247
+ states_ising, energy = zip(*[best_energy_search_xy(states[:, idx_state], probmat_ising) for idx_state in range(n_states)])
248
+
249
+ states_ising = numpy.array(states_ising).T
250
+ energy = numpy.array(energy)
251
+ return states_ising, energy
252
+
253
+
254
+ class XYModelParams():
255
+
256
+ """
257
+ ## Parameters for converting an Ising model to the XY model.
258
+
259
+ ### Members:
260
+ - `alphaR` - Reference lasers self coupling strength - default: 0.7
261
+ - `alphaI` - Vortex lasers self coupling strength - default: 0.7
262
+ - `coupAmp` - Coupling amplitude, default: 0.3
263
+ - `exFieldCoup` - Coupling of external field, default : 0.3
264
+ """
265
+ def __init__(self, alphaR = 0.7, alphaI = 0.7, coupAmp = 0.3, exFieldCoup = 0.3):
266
+ self.alphaI = alphaI
267
+ self.alphaR = alphaR
268
+ self.coupAmp = coupAmp
269
+ self.exFieldCoup = exFieldCoup
270
+
271
+ def __eq__(self, other: object) -> bool:
272
+ return isinstance(other, XYModelParams) and \
273
+ self.alphaI == other.alphaI and \
274
+ self.alphaR == other.alphaR and \
275
+ self.coupAmp == other.coupAmp and \
276
+ self.exFieldCoup == other.exFieldCoup
277
+
278
+
279
+ def coupling_matrix_xy(problem_matrix:numpy.ndarray, modelParamsXY:XYModelParams, external_field=False):
280
+ """
281
+ ## Generate the coupling matrix for the XY model.
282
+
283
+ ### Parameters:
284
+ - `problem_matrix` - The input problem matrix
285
+ - `modelParamsXY` - The parameters for the XY model
286
+ - `external_field` - Whether to include an external field in the model
287
+
288
+ ### Returns:
289
+ - `coupling_matrix` - The generated coupling matrix for the XY model
290
+ """
291
+ N = problem_matrix.shape[0]
292
+ max_sum_rows = numpy.max(numpy.sum(numpy.abs(problem_matrix), axis=1))
293
+
294
+ if external_field:
295
+ coupling_matrix = numpy.zeros((N + 1, N + 1), dtype=numpy.float32)
296
+ coupling_matrix[1:, 1:] = - (problem_matrix / max_sum_rows) * modelParamsXY.coupAmp
297
+ numpy.fill_diagonal(coupling_matrix[1:, 1:], modelParamsXY.alphaI)
298
+ coupling_matrix[1:, 0] = - modelParamsXY.exFieldCoup * (problem_matrix.diagonal() / max_sum_rows)
299
+ coupling_matrix[0, 0] = modelParamsXY.alphaR
300
+
301
+ else:
302
+ coupling_matrix = numpy.zeros((N, N), dtype=numpy.float32)
303
+ coupling_matrix = - (problem_matrix / max_sum_rows) * modelParamsXY.coupAmp
304
+ numpy.fill_diagonal(coupling_matrix, modelParamsXY.alphaI)
305
+
306
+ return coupling_matrix
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: lightsolver-lib
3
+ Version: 0.3.0
4
+ Summary: Tools for developers using LightSolver's Cloud Platform
5
+ Author-email: Matan Arkin <matan@lightsolver.com>
6
+ Project-URL: Homepage, https://lightsolver.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: Apache Software License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: numpy==1.26.4
14
+ Dynamic: license-file
15
+
16
+ # lightsolver-lib
17
+ Tools for developers using LightSolver's Cloud Platform.
18
+
@@ -0,0 +1,7 @@
1
+ lightsolver_lib/__init__.py,sha256=ysl4fmSUkxqHofrEv_en-z1CokBkP2uPiUGzIlHE7S0,627
2
+ lightsolver_lib/lightsolver_lib.py,sha256=G5h6JUOD6scmncuV5TVSDBdHmkaQ2X_hvmoa7ULgwfY,12360
3
+ lightsolver_lib-0.3.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
+ lightsolver_lib-0.3.0.dist-info/METADATA,sha256=we3a8cBcGHmWhAFLy-LtVi2QNHa2I5Q8TrG9aeCIkPg,592
5
+ lightsolver_lib-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ lightsolver_lib-0.3.0.dist-info/top_level.txt,sha256=N0GpFtPOKcY4VMlo2o841cnlmwKjN4zqADzg239UXHE,16
7
+ lightsolver_lib-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ lightsolver_lib