qiskit 1.4.0__cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl → 1.4.1__cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.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.
qiskit/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
Binary file
@@ -64,14 +64,20 @@ class Instruction(Operation):
64
64
  def __init__(self, name, num_qubits, num_clbits, params, duration=None, unit="dt", label=None):
65
65
  """Create a new instruction.
66
66
 
67
+ .. deprecated:: 1.3
68
+ The parameters ``duration`` and ``unit`` are deprecated since
69
+ Qiskit 1.3, and they will be removed in 2.0 or later.
70
+ An instruction's duration is defined in a backend's Target object.
71
+
67
72
  Args:
68
73
  name (str): instruction name
69
74
  num_qubits (int): instruction's qubit width
70
75
  num_clbits (int): instruction's clbit width
71
76
  params (list[int|float|complex|str|ndarray|list|ParameterExpression]):
72
77
  list of parameters
73
- duration (int or float): instruction's duration. it must be integer if ``unit`` is 'dt'
74
- unit (str): time unit of duration
78
+ duration (int|float): (DEPRECATED) instruction's duration. it must be
79
+ an integer if ``unit`` is ``'dt'``
80
+ unit (str): (DEPRECATED) time unit of duration
75
81
  label (str or None): An optional label for identifying the instruction.
76
82
 
77
83
  Raises:
qiskit/pulse/utils.py CHANGED
@@ -51,7 +51,7 @@ def format_parameter_value(
51
51
  decimal: Number of digit to round returned value.
52
52
 
53
53
  Returns:
54
- Value casted to non-parameter data type, when possible.
54
+ Value cast to non-parameter data type, when possible.
55
55
  """
56
56
  if isinstance(operand, ParameterExpression):
57
57
  try:
@@ -142,6 +142,8 @@ def _encode_replay_subs(subs, file_obj, version):
142
142
 
143
143
 
144
144
  def _write_parameter_expression_v13(file_obj, obj, version):
145
+ # A symbol is `Parameter` or `ParameterVectorElement`.
146
+ # `symbol_map` maps symbols to ParameterExpression (which may be a symbol).
145
147
  symbol_map = {}
146
148
  for inst in obj._qpy_replay:
147
149
  if isinstance(inst, _SUBS):
@@ -234,9 +236,17 @@ def _write_parameter_expression(file_obj, obj, use_symengine, *, version):
234
236
  # serialize key
235
237
  if symbol_key == type_keys.Value.PARAMETER_VECTOR:
236
238
  symbol_data = common.data_to_binary(symbol, _write_parameter_vec)
239
+ elif symbol_key == type_keys.Value.PARAMETER_EXPRESSION:
240
+ symbol_data = common.data_to_binary(
241
+ symbol,
242
+ _write_parameter_expression,
243
+ use_symengine=use_symengine,
244
+ version=version,
245
+ )
237
246
  else:
238
247
  symbol_data = common.data_to_binary(symbol, _write_parameter)
239
248
  # serialize value
249
+
240
250
  value_key, value_data = dumps_value(
241
251
  symbol, version=version, use_symengine=use_symengine
242
252
  )
@@ -516,10 +526,13 @@ def _read_parameter_expression_v13(file_obj, vectors, version):
516
526
  symbol = _read_parameter(file_obj)
517
527
  elif symbol_key == type_keys.Value.PARAMETER_VECTOR:
518
528
  symbol = _read_parameter_vec(file_obj, vectors)
529
+ elif symbol_key == type_keys.Value.PARAMETER_EXPRESSION:
530
+ symbol = _read_parameter_expression_v13(file_obj, vectors, version)
519
531
  else:
520
532
  raise exceptions.QpyError(f"Invalid parameter expression map type: {symbol_key}")
521
533
 
522
534
  elem_key = type_keys.Value(elem_data.type)
535
+
523
536
  binary_data = file_obj.read(elem_data.size)
524
537
  if elem_key == type_keys.Value.INTEGER:
525
538
  value = struct.unpack("!q", binary_data)
@@ -534,6 +547,7 @@ def _read_parameter_expression_v13(file_obj, vectors, version):
534
547
  binary_data,
535
548
  _read_parameter_expression_v13,
536
549
  vectors=vectors,
550
+ version=version,
537
551
  )
538
552
  else:
539
553
  raise exceptions.QpyError(f"Invalid parameter expression map type: {elem_key}")
@@ -59,6 +59,7 @@ class ApplyLayout(TransformationPass):
59
59
  q = QuantumRegister(len(layout), "q")
60
60
 
61
61
  new_dag = DAGCircuit()
62
+ new_dag.name = dag.name
62
63
  new_dag.add_qreg(q)
63
64
  for var in dag.iter_input_vars():
64
65
  new_dag.add_input_var(var)
@@ -142,6 +142,15 @@ class DrawerCanvas:
142
142
  def load_program(self, program: circuit.QuantumCircuit, target: Target | None = None):
143
143
  """Load quantum circuit and create drawing..
144
144
 
145
+ .. deprecated:: 1.3
146
+ Visualization of unscheduled circuits with the timeline drawer has been
147
+ deprecated in Qiskit 1.3.
148
+ This circuit should be transpiled with a scheduler, despite having instructions
149
+ with explicit durations.
150
+
151
+ .. deprecated:: 1.3
152
+ Targets with duration-less operations are going to error in Qiskit 2.0.
153
+
145
154
  Args:
146
155
  program: Scheduled circuit object to draw.
147
156
  target: The target the circuit is scheduled for. This contains backend information
@@ -52,6 +52,10 @@ def draw(
52
52
  ):
53
53
  r"""Generate visualization data for scheduled circuit programs.
54
54
 
55
+ .. deprecated:: 1.3
56
+ The ``target`` parameter needs to be specified in Qiskit 2.0 in order to get the
57
+ instruction durations.
58
+
55
59
  Args:
56
60
  program: Program to visualize. This program should be a `QuantumCircuit` which is
57
61
  transpiled with a scheduling_method, thus containing gate time information.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: qiskit
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
5
5
  Author-email: Qiskit Development Team <qiskit@us.ibm.com>
6
6
  License: Apache 2.0