Skip to content

Releases: Classiq/classiq-library

Classiq 0.41.0

04 Jul 12:49
Compare
Choose a tag to compare

Upgrade Instructions

Enhancement

  1. Hardware-aware synthesis
    will now use the Solovay-Kitaev algorithm to approximate
    single-qubit gates when the basis gate set is a specific variation of
    Clifford + T (X, Z, H, T, CX, and CCX).

  2. qsvt function was added to the function library.
    See Quantum Singular Value Transformation.

  3. A tutorial on discrete quantum walks was added to the tutorials library.
    See Discrete Quantum Walk.

  4. SDK: Quantum functions (@qfunc) can be recursive.

  5. SDK: PauliTerm can be used to declare a hamiltonian.
    [comment]: DO_NOT_TEST

    hamiltonian = [
        PauliTerm(pauli=[Pauli.I], coefficient=1),
        PauliTerm(pauli=[Pauli.Z, Pauli.X], coefficient=2),
    ]
  6. Introducing ExecutionSession which will allow choosing the execution
    primitive in the SDK
    without the need of changing/synthesizing the quantum program once again.
    [comment]: DO_NOT_TEST

    model = create_model(main)
    qprog = synthesize(model)
    preferences = ExecutionPreferences(num_shots=1200)
    execution_session = ExecutionSession(qprog, preferences)
    
    # if the quantum program does not need any execution paramters:
    execution_session.sample()
    
    # if the quantum program needs execution parameters:
    execution_session.sample({"phi": 1})
    
    # if multiple samples are needed:
    execution_session.batch_sample([{"phi": 1}, {"phi": 2}, {"phi": 3}])
    
    # if an estimation is needed without execution parameters:
    hamiltonian = [
        PauliTerm(pauli=[Pauli.I], coefficient=1),
        PauliTerm(pauli=[Pauli.Z], coefficient=2),
    ]
    execution_parameters.estimate(hamiltonian)
    
    # if an estimation is needed with execution paramters:
    execution_parameters.estimate(hamiltonian, {"theta": 1})
    
    # if multiple estimations are needed:
    execution_parameters.batch_estimate(hamiltonian, [{"theta": 1}, {"theta": 2}])
  7. A Qmod library reference, with usage examples for built-in and open library functions, can now be found in
    Qmod Library Reference.

Interface Changes

  1. SDK: In execute_qnn, the optional argument observables of type PauliOperators
    has been replaced with the optional argument observable of type PauliOperator.
  2. Documentation: The structure and content have the classiq documentation have been changed signficantly with the following new structure:

The old User Guide chapter from the previous documentation can be found in the new Reference Manual.

Deprecations

  1. SDK: The quantum_if operation and the old control syntax have been
    removed.
  • quantum_if is removed. Use control instead.
  • control(operand, ctrl) is no longer supported. Use
    control(ctrl, operand) instead.
  • control(n, operand) does not support quantum numeric variables (n).
    Instead, use a bind operation to cast n into a quantum array, or
    compare n to an integer explicitly (e.g., n == 7).
  1. SDK: The QParam type has been removed.
  • Instead of QParam[int], use CInt.
  • Instead of QParam[float], use CReal.
  • Instead of QParam[bool], use CBool.
  • Instead of QParam[List[...]], use CArray[...].
  • Instead of QParam[Array[..., size]], use CArray[..., size].
  1. Native Qmod: Accessing quantum variable properties (e.g., qbv.len or
    n.is_signed) via function call syntax (len(qbv), is_signed(qbv)) is no
    longer supported.

  2. The field optimizer_preferences of ExecutionPreferences has been removed.

  3. The function set_initial_values has been removed.

IDE

  1. "Slack" and "Learn More" links were moved from the side drawer to the IDE
    header. New links were added as well: Community, User Guide.

  2. Allow visualization of larger circuits and prolong the timeout for
    visualization

  3. Users can now download a LaTeX format of their quantum programs directly from
    the IDE, allowing for easy sharing, publication, and presentation of their
    work.

    plot

  4. Cookies settings are now available to adjust the given consent at any time.

Bug fixes

  1. "selected example not found" error when opening the IDE
  2. Resetting now clears preferences form instead of initializing from cache on
    the model page
  3. Naming for exported files on the Graphical Editor
  4. State vector measurement results ordering
  5. Parameter names in lambda expressions don't have to match the
    parameter names in operand declarations:

=== "Native"

  ```
  qfunc my_H(qb: qbit) {
      H(qb);
  }
  ...
  apply_to_all<my_H>(qba); // used to throw an error since "qb" != "target"
  ```

=== "Python"

  [comment]: DO_NOT_TEST
  ```python
  @qfunc
  def my_H(qb: QBit) -> None:
      H(qb)


  ...
  apply_to_all(my_H, qba)  # used to throw an error since "qb" != "target"
  ```

Classiq 0.40.0

04 Jul 12:48
Compare
Choose a tag to compare

Upgrade Instructions

Interface Changes

  1. The control and quantum_if statements have been unified into one
    statement in native QMOD and the SDK under the name control.
    • SDK: The unified control statement accepts a qbit (q), a q-array
      (qbv), or a comparison of a qnum and an integer (n == 5) as the
      first argument.
    • SDK: The old control syntax (with ctrl as the second argument) is
      deprecated and will be removed in the next release.
    • SDK: The quantum_if operator is deprecated and will be removed in the
      next release.
    • Native QMOD: quantum_if is no longer supported, use the new control
      statement instead.
  2. SDK: The QParam and Array types are deprecated and will be
    removed in the next release.
    • Instead of QParam[int], use CInt.
    • Instead of QParam[float], use CReal.
    • Instead of QParam[bool], use CBool.
    • Instead of QParam[List[...]], use CArray[...].
    • Instead of QParam[Array[..., size]], use CArray[..., size].
  3. SDK: Using Python types (int, bool, etc.) in struct declarations
    (@struct) is deprecated and will not be supported by the next release.
    Instead, use classical data types (CInt, CBool, etc., see above).
  4. Default timeout for sending jobs to AWS changed from 5 minutes to 4 hours.

Deprecations

  1. The error mitigation settings in the execution preferences are no longer
    available.
  2. The aer_simulator backend has been removed. Use Classiq's simulator backend
    instead (ClassiqSimulatorBackendNames.SIMULATOR).

Enhancements

  1. Improved error messages.

Bug fixes

  1. Fixed a bug preventing execution of circuits synthesized with hardware aware synthesis on Azure and IonQ.

Classiq 0.39.0

04 Jul 09:43
Compare
Choose a tag to compare

Upgrade Instructions

Enhancements

  1. Improved the native QMOD syntax of the repeat, if statements.
    For details, see Classical Control Flow.
  2. Improved the native QMOD syntax of the control, power, and invert statements.
    For details, see Quantum Operators.
  3. Added the classiq.execution.all_hardware_devices.get_all_hardware_devices
    function to the Python SDK.

Deprecations

  1. In the SDK, the classiq.analyzer.analyzer.Analyzer.get_available_devices method is
    deprecated. Use classiq.execution.all_hardware_devices.get_all_hardware_devices
    instead.

Interface Changes

  1. The len method for QArray, QCallableList, and QParam of lists, is now a property.
    use .len instead of .len().

Classiq 0.38.0

04 Jul 09:39
Compare
Choose a tag to compare

Upgrade Instructions

Overview

Release 0.38 achieves a major milestone in the migration to the new QMOD language. The following general changes are now in effect:

  1. In the IDE, Synthesis page is now removed. Writing and synthesizing models is now done exclusively in the Model page.
  2. All pre-defined models previously available in the Synthesis page in Json format are now available in the Model page in native QMOD syntax.
  3. Many QMOD language enhancements were introduced to enable the coding of all available models and applications, in both native QMOD and in its Python embedding (see detailed list below).
  4. A new QMOD reference manual, covering all the language concepts and constructs in both input formats, is available QMOD-language-reference.
  5. Documentation content covering old input formats - the Json input and the old SDK classes - has been removed

Language and SDK Enhancements

  1. Native QMOD now supports classical POD struct declaration, initialization, and member access.
  2. Native QMOD now supports within-apply statements.
  3. Native QMOD now supports generalized in-place quantum assignment.
  4. Add method parsed_counts_of_outputs to sample's result in the Python SDK, see
    sample.
  5. Constants can now be used in the qmod-python integration with the QConstant class.
  6. Native QMOD now supports global constants.
  7. The quantum numeric type can now receive sign and fraction digits as type arguments in parameter declarations, in both the SDK and native QMOD.
    • Native QMOD example: qnum<5, True, 2> to indicate a 5-bit signed number with 2 fraction digits.
    • SDK examples:
      • QNum[5, True, 2] to indicate a 5-bit signed number with 2 fraction digits (as a function argument)
      • QNum("x", 5, True, 2) to indicate a 5-bit signed number with 2 fraction digits (as a local variable)
  8. The amplitude encoding flavor of quantum arithmetic (*= operator) is now an in-place operation in both the SDK and native QMOD.

Interface Changes

  1. The QStruct decorator was renamed to struct in the qmod-python integration.
  2. The qfunc decorator is renamed to quantum_function. The newer QFunc and ExternalQFunc decorator are now available as qfunc and qfunc(external=True). Using either classes as a decorator is deprecated, and this feature may be removed in a future release.
  3. Similarly, a new cfunc decorator is now available, and using the class CFunc as a decorator is deprecated and may be removed in the future.
  4. Renamed GeneratedCircuit to QuantumProgram in the SDK.
  5. The QNum type does not accept size argument without sign and fraction digits.
  6. QNum on the right-hand side of bind statements must have sign and fraction digits (inferred from initialization or declaration).
  7. The Following async methods were removed from Analyzer class (The documented methods without the async suffix are still available and can be used instead):
    1. get_available_devices_async
    2. analyzer_app_async
    3. plot_hardware_connectivity_async
    4. get_hardware_comparison_table_async
  8. The method show_multiple_hardware_data was removed from RBAnalysis class. The async equivalent show_multiple_hardware_data_async can be used instead.
  9. Removed reinterpret_num operation (instead use QNum/allocate_num arguments).
  10. Removed split and join operation (instead use bind operation).

Classiq 0.30.0

04 Jul 09:18
Compare
Choose a tag to compare

Upgrade Instructions

Enhancement

  1. The SuzukiTrotter function now accepts parameters as coefficients for its pauli_list.
  2. The SuzukiTrotter function now has a disable_scheduling option to disable the reordering of Pauli terms.
  3. There is a new QDrift Hamiltonian evolution function.

Interface Changes

  1. Add the Classiq Provider as an execution backend preference. It contains the AER backends, that used to be inside IBMBackendPreferences, as well as the Nvidia simulator, which used to be in NvidiaBackendPreferences. See
    Classiq Provider
  2. Deprecate the NvidiaBackendPreferences.
  3. Python SDK: Change annotations of input and output QVar types - InputQVar[...] is now written Input[QVar[...]], and likewise for Output.