qumat 0.5.0__py3-none-any.whl → 0.5.0rc1__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.
@@ -14,8 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- import boto3
18
- from braket.aws import AwsDevice, AwsSession
17
+ from braket.aws import AwsDevice
19
18
  from braket.devices import LocalSimulator
20
19
  from braket.circuits import Circuit, FreeParameter
21
20
 
@@ -23,29 +22,15 @@ from braket.circuits import Circuit, FreeParameter
23
22
  def initialize_backend(backend_config):
24
23
  backend_options = backend_config["backend_options"]
25
24
  simulator_type = backend_options.get("simulator_type", "default")
26
- region = backend_options.get("region")
27
-
28
- # Create AWS session with region if specified
29
- aws_session = None
30
- if region:
31
- boto_session = boto3.Session(region_name=region)
32
- aws_session = AwsSession(boto_session=boto_session)
33
-
34
25
  if simulator_type == "local":
35
26
  return LocalSimulator()
36
27
  elif simulator_type == "default":
37
- return AwsDevice(
38
- "arn:aws:braket:::device/quantum-simulator/amazon/sv1",
39
- aws_session=aws_session,
40
- )
28
+ return AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
41
29
  else:
42
30
  print(
43
31
  f"Simulator type '{simulator_type}' is not supported in Amazon Braket. Using default."
44
32
  )
45
- return AwsDevice(
46
- "arn:aws:braket:::device/quantum-simulator/amazon/sv1",
47
- aws_session=aws_session,
48
- )
33
+ return AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
49
34
 
50
35
 
51
36
  def create_empty_circuit(num_qubits: int | None = None):
@@ -120,17 +105,7 @@ def execute_circuit(circuit, backend, backend_config):
120
105
  # placeholder method for use in the testing suite
121
106
  def get_final_state_vector(circuit, backend, backend_config):
122
107
  circuit.state_vector()
123
- parameter_values = backend_config.get("parameter_values", {})
124
- if parameter_values and circuit.parameters:
125
- # Braket accepts parameter names as strings in inputs dict
126
- inputs = {
127
- param_name: value
128
- for param_name, value in parameter_values.items()
129
- if param_name in {p.name for p in circuit.parameters}
130
- }
131
- result = backend.run(circuit, shots=0, inputs=inputs).result()
132
- else:
133
- result = backend.run(circuit, shots=0).result()
108
+ result = backend.run(circuit, shots=0).result()
134
109
  state_vector = result.values[0]
135
110
 
136
111
  return state_vector
qumat/cirq_backend.py CHANGED
@@ -159,12 +159,7 @@ def apply_u_gate(circuit, qubit_index, theta, phi, lambd):
159
159
 
160
160
  def get_final_state_vector(circuit, backend, backend_config):
161
161
  simulator = cirq.Simulator()
162
- parameter_values = backend_config.get("parameter_values", None)
163
- if parameter_values:
164
- resolver = cirq.ParamResolver(parameter_values)
165
- result = simulator.simulate(circuit, param_resolver=resolver)
166
- else:
167
- result = simulator.simulate(circuit)
162
+ result = simulator.simulate(circuit)
168
163
  return result.final_state_vector
169
164
 
170
165
 
qumat/qiskit_backend.py CHANGED
@@ -147,14 +147,6 @@ def get_final_state_vector(circuit, backend, backend_config):
147
147
  # Add save_statevector instruction
148
148
  working_circuit.save_statevector()
149
149
 
150
- # Bind parameters if present
151
- if working_circuit.parameters:
152
- parameter_values = backend_config.get("parameter_values", {})
153
- parameter_bindings = {
154
- param: parameter_values[str(param)] for param in working_circuit.parameters
155
- }
156
- working_circuit = working_circuit.assign_parameters(parameter_bindings)
157
-
158
150
  # Simulate the circuit
159
151
  transpiled_circuit = qiskit.transpile(working_circuit, simulator)
160
152
  job = simulator.run(transpiled_circuit)
qumat/qumat.py CHANGED
@@ -356,34 +356,13 @@ class QuMat:
356
356
  """Return the final state vector of the quantum circuit.
357
357
 
358
358
  The complete quantum state vector after circuit execution,
359
- representing the full quantum state of all qubits. For parameterized
360
- circuits, call bind_parameters() first to set parameter values.
359
+ representing the full quantum state of all qubits.
361
360
 
362
361
  :returns: The final state vector as a numpy array.
363
362
  :rtype: numpy.ndarray
364
363
  :raises RuntimeError: If the circuit has not been initialized.
365
- :raises ValueError: If parameterized circuit has unbound parameters.
366
364
  """
367
365
  self._ensure_circuit_initialized()
368
-
369
- # Only pass bound parameters (non-None values) to backend
370
- bound_parameters = {
371
- param: value
372
- for param, value in self.parameters.items()
373
- if value is not None
374
- }
375
-
376
- # Check if there are unbound parameters in the circuit
377
- if self.parameters and len(bound_parameters) < len(self.parameters):
378
- unbound_params = [
379
- p for p in self.parameters.keys() if self.parameters[p] is None
380
- ]
381
- raise ValueError(
382
- f"Circuit contains unbound parameters: {unbound_params}. "
383
- f"Please call bind_parameters() before get_final_state_vector()."
384
- )
385
-
386
- self.backend_config["parameter_values"] = bound_parameters
387
366
  return self.backend_module.get_final_state_vector(
388
367
  self.circuit, self.backend, self.backend_config
389
368
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qumat
3
- Version: 0.5.0
3
+ Version: 0.5.0rc1
4
4
  Summary: A library for composing quantum machine learning.
5
5
  Author-email: Apache Mahout <dev@mahout.apache.org>
6
6
  License-Expression: Apache-2.0
@@ -47,7 +47,7 @@ For additional information about Mahout, visit the [Mahout Home Page](http://mah
47
47
  ## Qumat
48
48
 
49
49
  <p align="center">
50
- <img src="https://raw.githubusercontent.com/apache/mahout/refs/heads/main/docs/assets/mascot_with_text.png" width="400" alt="Apache Mahout">
50
+ <img src="docs/assets/mascot_with_text.png" width="400" alt="Apache Mahout">
51
51
  </p>
52
52
 
53
53
  Qumat is a high-level Python library for quantum computing that provides:
@@ -0,0 +1,11 @@
1
+ qumat/__init__.py,sha256=HweBfNndHmuHN3X2t0JR9vP9wsfDqkjSzBbEdS0XfF0,854
2
+ qumat/amazon_braket_backend.py,sha256=dDCn4oXsZwQqJdQIMWQD29HiNGECxYulklEiqFZsnPo,5787
3
+ qumat/cirq_backend.py,sha256=jBdNQBi_86Z4cloDV1LXmhXRl7ae3mQbwf30AOjNrfY,6490
4
+ qumat/qdp.py,sha256=gKiQjlrB_oFwm--_LdJKPgO_XvXfhdV6XXtWHonbtFg,2332
5
+ qumat/qiskit_backend.py,sha256=ZjNbu3ToN9FLVL_C_3HLp5tS_wib0up48ibmUiq3VTI,6996
6
+ qumat/qumat.py,sha256=pzpi015z9MwIgrRok1MFJjcKfLGHVBFbzsswJEcdwEo,24308
7
+ qumat-0.5.0rc1.dist-info/METADATA,sha256=0IcBFH6ADR1rjAiFzaMtYFxCFLYVv3snED7k9r7GTtA,4606
8
+ qumat-0.5.0rc1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
+ qumat-0.5.0rc1.dist-info/licenses/LICENSE,sha256=PM3t-YVh-GyXESTynXe-orGOAJ9z1xBgh0mbsLdn0Co,12628
10
+ qumat-0.5.0rc1.dist-info/licenses/NOTICE,sha256=TBC-GYUVZqnqxC23u5wXAUvyMwYXx0-H4_NT5ASLmvM,295
11
+ qumat-0.5.0rc1.dist-info/RECORD,,
@@ -0,0 +1,7 @@
1
+ ==============================================================
2
+ Apache Mahout
3
+ Copyright 2009-2026 The Apache Software Foundation
4
+ ==============================================================
5
+
6
+ This product includes software developed by
7
+ The Apache Software Foundation (http://www.apache.org/).
@@ -1,11 +0,0 @@
1
- qumat/__init__.py,sha256=HweBfNndHmuHN3X2t0JR9vP9wsfDqkjSzBbEdS0XfF0,854
2
- qumat/amazon_braket_backend.py,sha256=wU8RTsCHbZ6GP02KriG7Y6TKfXHymXLVU5pzuURH_vQ,6635
3
- qumat/cirq_backend.py,sha256=GFc-k1FcP7TJordSBIGvJyQ6D00mmgVyTW92jNJ_UOM,6723
4
- qumat/qdp.py,sha256=gKiQjlrB_oFwm--_LdJKPgO_XvXfhdV6XXtWHonbtFg,2332
5
- qumat/qiskit_backend.py,sha256=70sNoylEq6ff4gyLILiVfhd8MF570HP09cVF1ZXy2gk,7344
6
- qumat/qumat.py,sha256=uatL6R73Y7N76hUuFaJeIAHaBezQUSj3eRNx3smHhgs,25230
7
- qumat-0.5.0.dist-info/METADATA,sha256=Ik8X05QGHeOALLFkY7BE95EH4amWTozQM0yPu7WxVVk,4667
8
- qumat-0.5.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
- qumat-0.5.0.dist-info/licenses/LICENSE,sha256=PM3t-YVh-GyXESTynXe-orGOAJ9z1xBgh0mbsLdn0Co,12628
10
- qumat-0.5.0.dist-info/licenses/NOTICE,sha256=kBwSL8-64NAWSlb95coi5GgPC2LYkj78XsfEi-tvcvk,167
11
- qumat-0.5.0.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- Apache Mahout
2
- Copyright 2009-2026 The Apache Software Foundation
3
-
4
- This product includes software developed at
5
- The Apache Software Foundation (https://www.apache.org/).