Classiq

Latest version: v0.58.1

Safety actively analyzes 682244 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.45.0

Upgrade Instructions

- [Python SDK](../classiq_101/registration_installations.md/platform-version-updates)
- The IDE upgrades automatically.

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);
}

0.44.0

Upgrade Instructions

- [Python SDK](../classiq_101/registration_installations.md/platform-version-updates)
- The IDE upgrades automatically.

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

<!-- cspell:ignore structs -->

1. Add support for arithmetic boolean expressions as conditionals for control statements;
see [here](../../reference-manual/qmod/language-reference/statements/control/).
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)


10. 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](../../explore/tutorials/hamiltonian_simulation/hamiltonian_simulation_with_block_encoding/hamiltonian_simulation_with_block_encoding/).
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](../../explore/algorithms/differential_equations/discrete_poisson_solver/discrete_poisson_solver/).
3. New state preparation functions - `prepare_unifrom_trimmed_state`, `prepare_unifrom_interval_state`, see [here](../../explore/functions/qmod_library_reference/classiq_open_library/special_state_preparations/prepare_partial_uniform_state/).
4. Enhanced the Discrete logarithm example to the case where the order is not power of 2, see [here](../../explore/algorithms/algebraic/discrete_log/discrete_log/).
5. Updated the [Quantum Types](https://docs.classiq.io/latest/reference-manual/platform/qmod/language-reference/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.

0.43.0

Upgrade Instructions

- [Python SDK](../classiq_101/registration_installations.md/platform-version-updates)
- The IDE upgrades automatically. Please note that you might need to clear your cache after the version update. See this [guide](https://uark.libanswers.com/faq/132649#:~:text=To%20clear%20your%20cache%20in,Menu%20in%20the%20upper%20right.&text=Choose%20%22Clear%20Browsing%20Data.%22,and%20restart%20to%20see%20changes) 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](../../explore/tutorials/technology_demonstrations/discrete_quantum_walk_circle/discrete_quantum_walk_circle/).
2. New rainbow options pricing notebooks in the public repository [research folder](../../explore/research).

0.42.0

Upgrade Instructions

- [Python SDK](../classiq_101/registration_installations.md/platform-version-updates)
- The IDE upgrades automatically.

Bug Fixes

1. Fixed an error related to the translation of certain circuits between synthesis and execution.
2. Fixed an error when calling a function with local variables multiple times.

Enhancements

1. HHL workshop was added to the public repository and to the User Guide.
2. It is now possible to use the execution primitives `estimate` and `vqe` with models
with multiple output ports. The hamiltonian should match all the output ports
by their order.
3. Amplitude encoding assignments (`ind *= foo(n)`) support all quantum numeric
variables, not only unsigned fractions.
4. Add support for lookup tables in amplitude encoding assignments, e.g.,
`ind *= [0, 0.5, 0.5, 1][n]` where `n` is an unsigned quantum integer
(`ind *= subscript([0, 0.5, 0.5, 1], n)` in the SDK).
5. A quantum COSINE and SINE transforms of types I and II were added to the open library,
see [Quantum COSINE and SINE Transforms](../explore/functions/qmod_library_reference/classiq_open_library/qct_qst/qct_qst.ipynb).
6. New algorithm was added to the library: "Variational Quantum Linear Solver (VQLS) with Linear Combination of Unitaries (LCU) Block Encoding"
[Variational Quantum Linear Solver](../explore/algorithms/vqls/lcu_vqls/vqls_with_lcu.ipynb)
7. `Alice & Bob` provider is now accessible.

Interface Changes

1. `compute_qaoa_initial_point` is now exposed in the SDK directly from `classiq` package.
`from classiq import compute_qaoa_initial_point`
2. The examples in IDE Flow page are replaced with a new arithmetics example.

Bug Fixes

1. Properly evaluate type attributes in `main`.
- Native Qmod: `qnum`'s sign field can be specified with lowercase
`true`/`false` in `main`'s signature.
2. Fix execution results received from running on Amazon Braket to be correct
when the measured outputs are not all of the variables of the model.
3. Improve language error reporting.

IDE

1. Uniform drawer width for all pages
2. New way to trigger node options context menu on Graphical Model page: node options menu can now be triggered by right-clicking a selected node

0.41.0

Upgrade Instructions

- [Python SDK](../classiq_101/registration_installations.md/platform-version-updates)
- The IDE upgrades automatically.

Enhancement

1. [Hardware-aware synthesis](../reference-manual/platform/synthesis/hardware-aware-synthesis.md)
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](../explore/functions/qmod_library_reference/classiq_open_library/qsvt/qsvt.ipynb).
3. A tutorial on discrete quantum walks was added to the tutorials library.
See [Discrete Quantum Walk](../explore/tutorials/discrete_quantum_walk/discrete_quantum_walk.ipynb).
4. SDK: Quantum functions (`qfunc`) can be recursive.
5. SDK: PauliTerm can be used to declare a hamiltonian.
[comment]: DO_NOT_TEST
python
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

python
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](../explore/functions/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:

- [What's Classiq](../whats_classiq.ipynb)
- [Classiq 101](../classiq_101/index.md)
- [Explore](../explore/index.md)
- [Read](../read/index.md)
- [Practice](../practice/index.md)
- [Reference Manual](../reference-manual/index.md)
- [Release Notes](../release-notes/0-41-0.md)

The old `User Guide` chapter from the previous documentation can be found in the new [Reference Manual](../reference-manual/platform/index.md).

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`).

2. 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]`.

3. 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.

4. The field `optimizer_preferences` of `ExecutionPreferences` has been removed.

5. 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](./resources/images/collage-circuit-latex.jpg)

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"

0.40.0

Upgrade Instructions

- [Python SDK](../getting-started/python-sdk.mdupdating-versions)
- The [IDE](../getting-started/ide.md) upgrades automatically.

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.

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.