Skip to content

Releases: Classiq/classiq-library

Classiq 0.52.0

31 Oct 08:21

Choose a tag to compare

Released on 2024-10-02.

Upgrade Instructions

Enhancements

  1. Optimize synthesis of variable and constant assignments (x ^= y, x += 3).
  2. The behavior of synthesis with debug_mode
    set to False has been changed, such that synthesis process is up to 50% faster. However,
    the resulting visualized quantum program may lose much of its hierarchical structure.
    Note that the default value for debug_mode is still True, and this mode's behavior remains unchanged.
  3. The maximum number of shots in a single execution on Nvidia simulators has
    been increased to 1,000,000.

Bug Fixes

  1. Improve circuit width estimation when machine_precision is set.
  2. Removing the non-gate-based devices from the available AWS Bracket devices.
  3. Fix n ^= 1 assignments where n has a single qubit
    (used to raise an exception).

Notice

  • With the release of this version (0.52.0),
    execution with older SDK versions may result in errors or unexpected behavior.
    To ensure proper execution of your quantum programs via the SDK,
    please upgrade to the latest version (See instructions guide above).

  • The Pydantic package dependency has been upgraded from version 1 to version 2.
    If you are using an older version of Pydantic in the same environment as our SDK,
    this may lead to compatibility issues.
    Note that installing or upgrading the SDK will also update your Pydantic version to V2.
    It is recommended to verify compatibility across your environment.

Classiq 0.51.0

29 Sep 13:20

Choose a tag to compare

Released on 2024-09-29.

Upgrade Instructions

Notice

  • With the release of version 0.52 (scheduled for the week of 06-12.10.2024),
    execution with older SDK versions might result in errors or unexpected behavior.
    In order to make sure executions of your quantum programs via the SDK work properly
    upgrade your SDK to the latest version (See instructions guide above).

Enhancements

  1. Improve qubit reuse in arithmetic operations when machine_precision is set.
  2. Improve error messages when executing circuits on Amazon Braket.
  3. Improve error messages when executing the VQE primitive.
  4. Support constant assignments: x |= 3, x ^= 3, and x += 3.

Bug Fixes

  1. Fix in-place XOR assignments (^=) of 1-qubit expressions into multi-qubit
    variables (used to raise an error).

SDK

  1. Add a new function, quantum_program_from_qasm, to convert a QASM string into a Quantum Program.

Classiq 0.50.0

25 Sep 11:42

Choose a tag to compare

Released on 2024-09-23.

Upgrade Instructions

Notice

  • With the release of version 0.52 (scheduled for the week of 06-12.10.2024),
    execution with older SDK versions might result in errors or unexpected behavior.
    In order to make sure executions of your quantum programs via the SDK work properly
    upgrade your SDK to the latest version (See instructions guide above).

Classiq 0.49.0

23 Sep 08:42

Choose a tag to compare

Released on 2024-09-16.

Upgrade Instructions

Notice

  • With the release of version 0.52 (scheduled for the week of 06-12.10.2024),
    execution with older SDK versions might result in errors or unexpected behavior.
    In order to make sure executions of your quantum programs via the SDK work properly
    upgrade your SDK to the latest version (See instructions guide above).

Bug Fixes

  1. Raise indicative error when circuit cannot be visualized.
  2. Fixed synthesis of arithmetic operations nested in a within-apply statement
    when machine_precision is set.

Classiq 0.48.0

23 Sep 08:41

Choose a tag to compare

Released on 2024-09-10.

Upgrade Instructions

Enhancements

  1. Improved error messages.
  2. Added SIGNED and UNSIGNED built-in constants to improve readability of
    QNum types. SDK: QNum[4, SIGNED, 1]. Native: qnum<4, SIGNED, 1>.
  3. QNum types can specify just the size property. SDK: QNum[4] and
    QNum("n", 4). Native: qnum<4>. Such types are unsigned
    (is_signed=False) integers (fraction_digits=0) by default.
  4. Execution on remote providers is no longer subject to any time limit when using ExecutionSession
    or executing models without classical execution code. Note: simulation on Classiq backends is still subject to time limit.
  5. In-place add operations (inplace_add) now support signed variables.

Bug Fixes

  1. Fixed an operand-related bug. Might occur when calling a function recursively
    in one of its operands (for example: foo(lambda: foo(...))).
  2. Fixed an expression-related bug. Might occur when using the same variable
    in multiple expressions.
  3. Fixed in-place XOR operations (^= / inplace_xor) in the presence of
    signed variables. The sign variable is now interpreted as part of the
    significand without special treatment.
  4. Fixed synthesis of arithmetic operations nested in a within-apply statement.

Interface Changes

  1. SDK: Deprecated parameter names in built-in operations were removed.
    • control(ctrl=..., operand=...) => control(ctrl=..., stmt_block=...)
    • within_apply(compute=..., action=...) => within_apply(within=..., apply=...)
    • power(power=..., operand=...) => power(exponent=..., stmt_block=...)
    • invert(operand=) => invert(stmt_block=...)

Library Additions

  1. Added a new notebook for solving the Differential equation using the HHL Algorithm, to simulate war games.

Classiq 0.47.0

23 Sep 08:36

Choose a tag to compare

Upgrade Instructions

Enhancements

  1. Cancelling an execution job will now result in cancellation of any ongoing jobs sent to the provider during the execution. For more information, see Cancellation.

Library and Documentation

  1. A new tutorial on the Oblivious Amplitude Amplification algorithm was added.

SDK

  1. The Classiq SDK now supports Python 3.12.

Classiq 0.46.0

23 Sep 08:36

Choose a tag to compare

Upgrade Instructions

Enhancements

  1. Improve synthesis performance in unconstrained large models by lowering circuit width via qubit recycling.

Deprecations

  1. The Classiq SDK will drop support for Python 3.8 near its end-of-life on October 2024.

Classiq 0.45.0

22 Aug 07:18
ef10e2e

Choose a tag to compare

Upgrade Instructions

Enhancements

  1. Add size attribute to quantum variables:

=== "SDK"

[comment]: DO_NOT_TEST

``` python
@qfunc
def main(my_struct: Output[MyStruct]) -> None:
    allocate(my_struct.size, my_struct)
```

=== "Native"

```
qfunc main(output my_struct: MyStruct) {
  allocate(my_struct.size, my_struct);
}
```

Classiq 0.44.0

15 Aug 08:04

Choose a tag to compare

Upgrade Instructions

Bug Fixes

  1. Fixed a bug related to nested control operations.
  2. Fixed a bug related to boolean arithmetic expressions with invert.
  3. Fixed a bug related to arithmetic expressions inside within-apply.

IDE

  1. Add back improved circuit nodes search.
  2. Fix bug in Quantum Program page .qprog file extensions uploads.
  3. New Quantum Program export option: Quantum programs can now be exported as .qprog files.
  4. Poll all active jobs in the job list, not just the selected job.
  5. Add support for Alice & Bob hardware configurations in the IDE.
  6. Add support for QCtrl API key configuration in IBM hardware settings.

Enhancements

  1. Add support for arithmetic boolean expressions as conditionals for control statements;
    see here.
  2. Add quantum structs.
  3. The element type of quantum arrays can be any quantum type. N-dimensional quantum arrays are supported.
  4. Operand parameter names are optional in both Native
    (qfunc (indicator: qbit) -> qfunc (qbit)) and Python
    (QCallable[QBit] -> QCallable[Annotated[QBit, "indicator"]]) Qmod.
  5. Improve error messages.
  6. Provide better circuits for certain boolean arithmetic expressions.
  7. Improved qubit reuse and runtime performance for model without constraints.
  8. Add solovay_kitaev_max_iterations field to the synthesis preferences,
    allowing for tuning the accuracy of the Solovay-Kitaev algorithm.
  9. Built-in classical functions to decompose/compose a matrix into/from a Hamiltonian. Example of usage:

=== "SDK"

[comment]: DO_NOT_TEST

``` python
mat = np.array([[0, 1, 2, 3], [1, 4, 5, 6], [2, 5, 7, 8], [3, 6, 8, 9]])
hamiltonian = matrix_to_hamiltonian(mat)
mat = hamiltonian_to_matrix(hamiltonian)
```
  1. parsed_states, parsed_counts, parsed_state_vector will contain the parsed execution details as lists if a quantum array was used in the model.

=== "SDK"

[comment]: DO_NOT_TEST

``` python
@qfunc
def main(qna: Output[QArray[QNum[3, True, 0]]]) -> None:
    allocate(6, qna)
    hadamard_transform(qna)


qp = synthesize(create_model(main))
res = execute(qp).result()
print(res[0].value.parsed_counts[0])
```

previously this would print -> state={'qna': 43} shots=27
now it prints -> state={'qna': [-2, 3]} shots=27

Library and Documentation

  1. A new tutorial on Hamiltonian simulation for block-encoded Hamiltonians, using QSVT and Qubitization, was added to
    the library; see here.
  2. A new tutorial on solving the discrete Poisson's equation using the HHL algorithm, combined with quantum sine and
    cosine transforms, was added to the library;
    see here.
  3. New state preparation functions - prepare_unifrom_trimmed_state, prepare_unifrom_interval_state, see here.
  4. Enhanced the Discrete logarithm example to the case where the order is not power of 2, see here.
  5. Updated the Quantum Types documentation page.

Interface Changes

  1. Some builtin operations parameters have been renamed:
    • control(ctrl=..., operand=...) => control(ctrl=..., stmt_block=...)
    • within_apply(compute=..., action=...) => within_apply(within=..., apply=...)
    • power(power=..., operand=...) => power(exponent=..., stmt_block=...)
    • invert(operand=) => invert(stmt_block=...)

Deprecations

  1. SDK: The @struct decorator has been removed. Define classical structs
    using @dataclass.
  2. The field variance in EstimationResult is deprecated, and will be
    populated with the value -1 until removed.
  3. The field timeout_sec in ExecutionPreferences, and the field
    job_timeout in AwsBackendPreferences, have been removed.
  4. classical arguments in the native language are now inside the parentheses
    section ((...)) alongside quantum variables
    and not inside the angle brackets (<...>), the angle brackets section is
    now considered deprecated.
    For example, you should
    migrate: qfunc <a: real> main{...} -> qfunc main(a: real) {...}
    for info refer to the language reference about functions.
    A Warning was added to the IDE in the case it is used.

Classiq 0.43.0

04 Jul 14:48

Choose a tag to compare

Upgrade Instructions

  • Python SDK
  • The IDE upgrades automatically. Please note that you might need to clear your cache after the version update. See this guide for help.

Enhancements

  1. Support signed quantum numerics in in-place-xor assignments (^=).
  2. Support quantum array subscripts in quantum expressions.
  3. Support quantum numeric arrays.
  4. Improve synthesis performance.
  5. Apply an automatic qubit reuse pass when the model is unconstrained.
  6. Add user-defined enums.

=== "Native"

  ```
  qfunc main(output res: qbit) {
    allocate<1>(res);
    qnv: qnum<2, False, 0>[]; // quantum numeric array
    allocate<6>(qnv);
    repeat (i: qnv.len) { inplace_prepare_int<i + 1>(qnv[i]); }
    res ^= qnv[0] + qnv[1] == qnv[2];  // array subscripts in expressions
  }
  ```

=== "Python"

  [comment]: DO_NOT_TEST
  ```python
  @qfunc
  def main(res: Output[QBit]) -> None:
      allocate(1, res)
      qnv: QArray = QArray("qnv", element_type=QNum[2, False, 0])  # quantum numeric array
      allocate(6, qnv)
      repeat(qnv.len, lambda i: inplace_prepare_int(i + 1, qnv[i]))
      res ^= qnv[0] + qnv[1] == qnv[2]  # array subscripts in expressions
  ```

Interface Changes

  1. The classical scope in Qmod no longer supports function definitions.
  2. The aer_simulator, aer_simulator_statevector, aer_simulator_density_matrix, and aer_simulator_matrix_product_state Classiq backends are no longer accessible in the SDK. Use simulator, simulator_statevector, simulator_density_matrix, and simulator_matrix_product_state instead.
  3. The @struct decorator is deprecated and will be removed in a future
    release. Use @dataclass instead.

Bug Fixes

  1. Fixed a bug where multiple in-place assignment statements resulted in a 22102 error.
  2. Fixed a bug where using the same variable in control operation for both the control operation and the body resulted in a non-indicative error.
  3. Fix invert and within-apply variable initialization tracking in native
    Qmod.
  4. Fix division with classical symbolic variables.
  5. Fix rogue comma inserted to the chemistry model classical execution code
    after IDE form update.
  6. Fix reporting uninitialized quantum variables in arithmetic expressions as
    undefined.
  7. Fix double execution on devices requiring access tokens.
  8. Fix execution configuration being applied only to the first selected device, when one of the selected devices requires an access token.
  9. Fix a bug where Grover circuit was incorrect when reflecting about states different than uniform superposition.
  10. Fix a synthesis bug that could appear in models that constrain the width and optimize depth or vice versa.

IDE

  1. Graphical Model tab redesign of nodes (Function call, Output, Assignment).
  2. Restructure of node categories (Graphical Model).
  3. Fix countries list not loading sometimes during registration.
  4. Prevent QMOD editor from crashing when compiler crashes.
  5. Redesigned the Accordion and Icon status for jobs.
  6. Quantum Program tabs moved to the left drawer.
  7. Uploading Quantum Program can now be done using the Upload button on the left drawer.
  8. 3 newly introduced tabs of Quantum Program data: Transpiled Info, Program Info, Data.

Library Additions

  1. A new technology demonstration notebook, treating a discrete quantum walk on a circle,
    was added to the library; see here.
  2. New rainbow options pricing notebooks in the public repository research folder.