Pennylane

Latest version: v0.39.0

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

Scan your dependencies

Page 10 of 11

0.4.1

<h3>Improvements</h3>

* Catalyst wheels are now packaged with OpenMP and ZStd, which avoids installing additional requirements separately in order to use pre-packaged Catalyst binaries. [(457)](https://github.com/PennyLaneAI/catalyst/pull/457) [(#478)](https://github.com/PennyLaneAI/catalyst/pull/478)

Note that OpenMP support for the `lightning.kokkos` backend has been disabled on macOS x86_64, due to memory issues in the computation of Lightning's adjoint-jacobian in the presence of multiple OMP threads.

<h3>Bug fixes</h3>

* Resolve an infinite recursion in the decomposition of the `Controlled` operator whenever computing a Unitary matrix for the operator fails. [(468)](https://github.com/PennyLaneAI/catalyst/pull/468)

* Resolve a failure to generate gradient code for specific input circuits. [(439)](https://github.com/PennyLaneAI/catalyst/issues/439)

In this case, [`jnp.mod`](https://github.com/PennyLaneAI/catalyst/issues/437) was used to compute wire values in a for loop, which prevented the gradient architecture from fully separating quantum and classical code. The following program is now supported:

py
qjit
grad
qml.qnode(dev)
def f(x):
def cnot_loop(j):
qml.CNOT(wires=[j, jnp.mod((j + 1), 4)])

for_loop(0, 4, 1)(cnot_loop)()

return qml.expval(qml.PauliZ(0))


* Resolve unpredictable behaviour when importing libraries that share Catalyst's LLVM dependency (e.g. TensorFlow). In some cases, both packages exporting the same symbols from their shared libraries can lead to process crashes and other unpredictable behaviour, since the wrong functions can be called if both libraries are loaded in the current process. The fix involves building shared libraries with hidden (macOS) or protected (linux) symbol visibility by default, exporting only what is necessary. [(465)](https://github.com/PennyLaneAI/catalyst/pull/465)

* Resolve a failure to find the SciPy OpenBLAS library when running Catalyst, due to a different SciPy version being used to build Catalyst than to run it. [(471)](https://github.com/PennyLaneAI/catalyst/pull/471)

* Resolve a memory leak in the runtime stemming from missing calls to device destructors at the end of programs. [(446)](https://github.com/PennyLaneAI/catalyst/pull/446)

<h3>Contributors</h3>

This release contains contributions from (in alphabetical order):

Ali Asadi, David Ittah.

0.4.0

<h3>New features</h3>

* Catalyst is now accessible directly within the PennyLane user interface, once Catalyst is installed, allowing easy access to Catalyst just-in-time functionality.

Through the use of the `qml.qjit` decorator, entire workflows can be JIT compiled down to a machine binary on first-function execution, including both quantum and classical processing. Subsequent calls to the compiled function will execute the previously-compiled binary, resulting in significant performance improvements.

python
import pennylane as qml

dev = qml.device("lightning.qubit", wires=2)

qml.qjit
qml.qnode(dev)
def circuit(theta):
qml.Hadamard(wires=0)
qml.RX(theta, wires=1)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(wires=1))


pycon
>>> circuit(0.5) the first call, compilation occurs here
array(0.)
>>> circuit(0.5) the precompiled quantum function is called
array(0.)


Currently, PennyLane supports the [Catalyst hybrid compiler](https://github.com/pennylaneai/catalyst) with the `qml.qjit` decorator, which directly aliases Catalyst's `catalyst.qjit`.

In addition to the above `qml.qjit` integration, the following native PennyLane functions can now be used with the `qjit` decorator: `qml.adjoint`, `qml.ctrl`, `qml.grad`, `qml.jacobian`, `qml.vjp`, `qml.jvp`, and `qml.adjoint`, `qml.while_loop`, `qml.for_loop`, `qml.cond`. These will alias to the corresponding Catalyst functions when used within a `qjit` context.

For more details on these functions, please refer to the [PennyLane compiler documentation](https://docs.pennylane.ai/en/stable/introduction/compiling_workflows.html) and [compiler module documentation](https://docs.pennylane.ai/en/stable/code/qml_compiler.html).

* Just-in-time compiled functions now support asynchronous execution of QNodes. [(374)](https://github.com/PennyLaneAI/catalyst/pull/374) [(#381)](https://github.com/PennyLaneAI/catalyst/pull/381) [(#420)](https://github.com/PennyLaneAI/catalyst/pull/420) [(#424)](https://github.com/PennyLaneAI/catalyst/pull/424) [(#433)](https://github.com/PennyLaneAI/catalyst/pull/433)

Simply specify `async_qnodes=True` when using the `qjit` decorator to enable the async execution of QNodes. Currently, asynchronous execution is only supported by `lightning.qubit` and `lightning.kokkos`.

Asynchronous execution will be most beneficial for just-in-time compiled functions that contain --- or generate --- multiple QNodes.

For example,

python
dev = qml.device("lightning.qubit", wires=2)

qml.qnode(device=dev)
def circuit(params):
qml.RX(params[0], wires=0)
qml.RY(params[1], wires=1)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(wires=0))

qjit(async_qnodes=True)
def multiple_qnodes(params):
x = jnp.sin(params)
y = jnp.cos(params)
z = jnp.array([circuit(x), circuit(y)]) will be executed in parallel
return circuit(z)

pycons
>>> func(jnp.array([1.0, 2.0]))
1.0


Here, the first two circuit executions will occur in parallel across multiple threads, as their execution can occur independently.

* Preliminary support for PennyLane transforms has been added. [(280)](https://github.com/PennyLaneAI/catalyst/pull/280)

python
qjit
qml.transforms.split_non_commuting
qml.qnode(dev)
def circuit(x):
qml.RX(x,wires=0)
return [qml.expval(qml.PauliY(0)), qml.expval(qml.PauliZ(0))]


pycon
>>> circuit(0.4)
[array(-0.51413599), array(0.85770868)]


Currently, most PennyLane transforms will work with Catalyst as long as:

- The circuit does not include any Catalyst-specific features, such
as Catalyst control flow or measurement,

- The QNode returns only lists of measurement processes,

- AutoGraph is disabled, and

- The transformation does not require or depend on the numeric value of
dynamic variables.

* Catalyst now supports just-in-time compilation of dynamically-shaped arrays. [(366)](https://github.com/PennyLaneAI/catalyst/pull/366) [(#386)](https://github.com/PennyLaneAI/catalyst/pull/385) [(#390)](https://github.com/PennyLaneAI/catalyst/pull/390) [(#411)](https://github.com/PennyLaneAI/catalyst/pull/411)

The `qjit` decorator can now be used to compile functions that accepts or contain tensors whose dimensions are not known at compile time; runtime execution with different shapes is supported without recompilation.

In addition, standard tensor initialization functions `jax.numpy.ones`, `jnp.zeros`, and `jnp.empty` now accept dynamic variables (where the value is only known at runtime).

python
qjit
def func(size: int):
return jax.numpy.ones([size, size], dtype=float)


pycon
>>> func(3)
[[1. 1. 1.]
[1. 1. 1.]
[1. 1. 1.]]


When passing tensors as arguments to compiled functions, the `abstracted_axes` keyword argument to the `qjit` decorator can be used to specify which axes of the input arguments should be treated as abstract (and thus avoid recompilation).

For example, without specifying `abstracted_axes`, the following `sum` function would recompile each time an array of different size is passed as an argument:

pycon
>>> qjit
>>> def sum_fn(x):
>>> return jnp.sum(x)
>>> sum_fn(jnp.array([1])) Compilation happens here.
>>> sum_fn(jnp.array([1, 1])) And here!


By passing `abstracted_axes`, we can specify that the first axes of the first argument is to be treated as dynamic during initial compilation:

pycon
>>> qjit(abstracted_axes={0: "n"})
>>> def sum_fn(x):
>>> return jnp.sum(x)
>>> sum_fn(jnp.array([1])) Compilation happens here.
>>> sum_fn(jnp.array([1, 1])) No need to recompile.


Note that support for dynamic arrays in control-flow primitives (such as loops), is not yet supported.

* Error mitigation using the zero-noise extrapolation method is now available through the `catalyst.mitigate_with_zne` transform. [(324)](https://github.com/PennyLaneAI/catalyst/pull/324) [(#414)](https://github.com/PennyLaneAI/catalyst/pull/414)

For example, given a noisy device (such as noisy hardware available through Amazon Braket):

python
dev = qml.device("noisy.device", wires=2)

qml.qnode(device=dev)
def circuit(x, n):

for_loop(0, n, 1)
def loop_rx(i):
qml.RX(x, wires=0)

loop_rx()

qml.Hadamard(wires=0)
qml.RZ(x, wires=0)
loop_rx()
qml.RZ(x, wires=0)
qml.CNOT(wires=[1, 0])
qml.Hadamard(wires=1)
return qml.expval(qml.PauliY(wires=0))

qjit
def mitigated_circuit(args, n):
s = jax.numpy.array([1, 2, 3])
return mitigate_with_zne(circuit, scale_factors=s)(args, n)


pycon
>>> mitigated_circuit(0.2, 5)
0.5655341100116512


In addition, a mitigation dialect has been added to the MLIR layer of Catalyst. It contains a Zero Noise Extrapolation (ZNE) operation, with a lowering to a global folded circuit.

<h3>Improvements</h3>

* The three backend devices provided with Catalyst, `lightning.qubit`, `lightning.kokkos`, and `braket.aws`, are now dynamically loaded at runtime. [(343)](https://github.com/PennyLaneAI/catalyst/pull/343) [(#400)](https://github.com/PennyLaneAI/catalyst/pull/400)

This takes advantage of the new backend plugin system provided in Catalyst v0.3.2, and allows the devices to be packaged separately from the runtime CAPI. Provided backend devices are now loaded at runtime, instead of being linked at compile time.

For more details on the backend plugin system, see the [custom devices documentation](https://docs.pennylane.ai/projects/catalyst/en/stable/dev/custom_devices.html).

* Finite-shot measurement statistics (`expval`, `var`, and `probs`) are now supported for the `lightning.qubit` and `lightning.kokkos` devices. Previously, exact statistics were returned even when finite shots were specified. [(392)](https://github.com/PennyLaneAI/catalyst/pull/392) [(#410)](https://github.com/PennyLaneAI/catalyst/pull/410)

pycon
>>> dev = qml.device("lightning.qubit", wires=2, shots=100)
>>> qjit
>>> qml.qnode(dev)
>>> def circuit(x):
>>> qml.RX(x, wires=0)
>>> return qml.probs(wires=0)
>>> circuit(0.54)
array([0.94, 0.06])
>>> circuit(0.54)
array([0.93, 0.07])


* Catalyst gradient functions `grad`, `jacobian`, `jvp`, and `vjp` can now be invoked from outside a `qjit` context. [(375)](https://github.com/PennyLaneAI/catalyst/pull/375)

This simplifies the process of writing functions where compilation can be turned on and off easily by adding or removing the decorator. The functions dispatch to their JAX equivalents when the compilation is turned off.

python
dev = qml.device("lightning.qubit", wires=2)

qml.qnode(dev)
def circuit(x):
qml.RX(x, wires=0)
return qml.expval(qml.PauliZ(0))


pycon
>>> grad(circuit)(0.54) dispatches to jax.grad
Array(-0.51413599, dtype=float64, weak_type=True)
>>> qjit(grad(circuit))(0.54). differentiates using Catalyst
array(-0.51413599)


* New `lightning.qubit` configuration options are now supported via the `qml.device` loader, including Markov Chain Monte Carlo sampling support. [(369)](https://github.com/PennyLaneAI/catalyst/pull/369)

python
dev = qml.device("lightning.qubit", wires=2, shots=1000, mcmc=True)

qml.qnode(dev)
def circuit(x):
qml.RX(x, wires=0)
return qml.expval(qml.PauliZ(0))


pycon
>>> circuit(0.54)
array(0.856)


* Improvements have been made to the runtime and quantum MLIR dialect in order to support asynchronous execution.

- The runtime now supports multiple active devices managed via a device pool. The new `RTDevice` data-class and `RTDeviceStatus` along with the `thread_local` device instance pointer enable the runtime to better scope the lifetime of device instances concurrently. With these changes, one can create multiple active devices and execute multiple programs in a multithreaded environment. [(381)](https://github.com/PennyLaneAI/catalyst/pull/381)

- The ability to dynamically release devices has been added via `DeviceReleaseOp` in the Quantum MLIR dialect. This is lowered to the `__quantum__rt__device_release()` runtime instruction, which updates the status of the device instance from `Active` to `Inactive`. The runtime will reuse this deactivated instance instead of creating a new one automatically at runtime in a multi-QNode workflow when another device with identical specifications is requested. [(381)](https://github.com/PennyLaneAI/catalyst/pull/381)

- The `DeviceOp` definition in the Quantum MLIR dialect has been updated to lower a tuple of device information `('lib', 'name', 'kwargs')` to a single device initialization call `__quantum__rt__device_init(int8_t *, int8_t *, int8_t *)`. This allows the runtime to initialize device instances without keeping partial information of the device. [(396)](https://github.com/PennyLaneAI/catalyst/pull/396)

* The quantum adjoint compiler routine has been extended to support function calls that affect the quantum state within an adjoint region. Note that the function may only provide a single result consisting of the quantum register. By itself this provides no user-facing changes, but compiler pass developers may now generate quantum adjoint operations around a block of code containing function calls as well as quantum operations and control flow operations. [(353)](https://github.com/PennyLaneAI/catalyst/pull/353)

* The allocation and deallocation operations in MLIR (`AllocOp`, `DeallocOp`) now follow simple value semantics for qubit register values, instead of modelling memory in the MLIR trait system. Similarly, the frontend generates proper value semantics by deallocating the final register value.

The change enables functions at the MLIR level to accept and return quantum register values, which would otherwise not be correctly identified as aliases of existing register values by the bufferization system. [(360)](https://github.com/PennyLaneAI/catalyst/pull/360)

<h3>Breaking changes</h3>

* Third party devices must now provide a configuration TOML file, in order to specify their supported operations, measurements, and features for Catalyst compatibility. For more information please visit the [Custom Devices](https://docs.pennylane.ai/projects/catalyst/en/latest/dev/custom_devices.html) section in our documentation. [(#369)](https://github.com/PennyLaneAI/catalyst/pull/369)

<h3>Bug fixes</h3>

* Resolves a bug in the compiler's differentiation engine that results in a segmentation fault when [attempting to differentiate non-differentiable quantum operations](https://github.com/PennyLaneAI/catalyst/issues/384). The fix ensures that all existing quantum operation types are removed during gradient passes that extract classical code from a QNode function. It also adds a verification step that will raise an error if a gradient pass cannot successfully eliminate all quantum operations for such functions. [(#397)](https://github.com/PennyLaneAI/catalyst/issues/397)

* Resolves a bug that caused unpredictable behaviour when printing string values with the `debug.print` function. The issue was caused by non-null-terminated strings. [(418)](https://github.com/PennyLaneAI/catalyst/pull/418)

<h3>Contributors</h3>

This release contains contributions from (in alphabetical order):

Ali Asadi,
David Ittah,
Romain Moyard,
Sergei Mironov,
Erick Ochoa Lopez,
Shuli Shu.

0.3.2post1

This post-release updates the docs with up-to-date information & additional sections for the installation guide.

0.3.2

<h3>New features</h3>

* The experimental AutoGraph feature now supports Python `while` loops, allowing native Python loops to be captured and compiled with Catalyst. [(318)](https://github.com/PennyLaneAI/catalyst/pull/318)

python
dev = qml.device("lightning.qubit", wires=4)

qjit(autograph=True)
qml.qnode(dev)
def circuit(n: int, x: float):
i = 0

while i < n:
qml.RX(x, wires=i)
i += 1

return qml.expval(qml.PauliZ(0))


pycon
>>> circuit(4, 0.32)
array(0.94923542)


This feature extends the existing AutoGraph support for Python `for` loops and `if` statements introduced in v0.3. Note that TensorFlow must be installed for AutoGraph support.

For more details, please see the [AutoGraph guide](https://docs.pennylane.ai/projects/catalyst/en/stable/dev/autograph.html).

* In addition to loops and conditional branches, AutoGraph now supports native Python `and`, `or` and `not` operators in Boolean expressions. [(325)](https://github.com/PennyLaneAI/catalyst/pull/325)

python
dev = qml.device("lightning.qubit", wires=1)

qjit(autograph=True)
qml.qnode(dev)
def circuit(x: float):

if x >= 0 and x < jnp.pi:
qml.RX(x, wires=0)

return qml.probs()


pycon
>>> circuit(0.43)
array([0.95448287, 0.04551713])
>>> circuit(4.54)
array([1., 0.])


Note that logical Boolean operators will only be captured by AutoGraph if all operands are dynamic variables (that is, a value known only at runtime, such as a measurement result or function argument). For other use cases, it is recommended to use the `jax.numpy.logical_*` set of functions where appropriate.

* Debug compiled programs and print dynamic values at runtime with ``debug.print`` [(279)](https://github.com/PennyLaneAI/catalyst/pull/279) [(#356)](https://github.com/PennyLaneAI/catalyst/pull/356)

You can now print arbitrary values from your running program, whether they are arrays, constants, strings, or abitrary Python objects. Note that while non-array Python objects *will* be printed at runtime, their string representation is captured at compile time, and thus will always be the same regardless of program inputs. The output for arrays optionally includes a descriptor for how the data is stored in memory ("memref").

python
qjit
def func(x: float):
debug.print(x, memref=True)
debug.print("exit")


pycon
>>> func(jnp.array(0.43))
MemRef: base = 0x5629ff2b6680 rank = 0 offset = 0 sizes = [] strides = [] data =
0.43
exit


* Catalyst now officially supports macOS X86_64 devices, with macOS binary wheels available for both AARCH64 and X86_64. [(347)](https://github.com/PennyLaneAI/catalyst/pull/347) [(#313)](https://github.com/PennyLaneAI/catalyst/pull/313)

* It is now possible to dynamically load third-party Catalyst compatible devices directly into a pre-installed Catalyst runtime on Linux. [(327)](https://github.com/PennyLaneAI/catalyst/pull/327)

To take advantage of this, third-party devices must implement the `Catalyst::Runtime::QuantumDevice` interface, in addition to defining the following method:

cpp
extern "C" Catalyst::Runtime::QuantumDevice*
getCustomDevice() { return new CustomDevice(); }


This support can also be integrated into existing PennyLane Python devices that inherit from the `QuantumDevice` class, by defining the `get_c_interface` static method.

For more details, see the [custom devices documentation](https://docs.pennylane.ai/projects/catalyst/en/stable/dev/custom_devices.html).

<h3>Improvements</h3>

* Return values of conditional functions no longer need to be of exactly the same type. Type promotion is automatically applied to branch return values if their types don't match. [(333)](https://github.com/PennyLaneAI/catalyst/pull/333)

python
qjit
def func(i: int, f: float):

cond(i < 3)
def cond_fn():
return i

cond_fn.otherwise
def otherwise():
return f

return cond_fn()


pycon
>>> func(1, 4.0)
array(1.0)


Automatic type promotion across conditional branches also works with AutoGraph:

python
qjit(autograph=True)
def func(i: int, f: float):

if i < 3:
i = i
else:
i = f

return i


pycon
>>> func(1, 4.0)
array(1.0)


* AutoGraph now supports converting functions even when they are invoked through functional wrappers such as `adjoint`, `ctrl`, `grad`, `jacobian`, etc. [(336)](https://github.com/PennyLaneAI/catalyst/pull/336)

For example, the following should now succeed:

python
def inner(n):
for i in range(n):
qml.T(i)

qjit(autograph=True)
qml.qnode(dev)
def f(n: int):
adjoint(inner)(n)
return qml.state()


* To prepare for Catalyst's frontend being integrated with PennyLane, the appropriate plugin entry point interface has been added to Catalyst. [(331)](https://github.com/PennyLaneAI/catalyst/pull/331)

For any compiler packages seeking to be registered in PennyLane, the `entry_points` metadata under the the group name `pennylane.compilers` must be added, with the following try points:

- `context`: Path to the compilation evaluation context manager. This context manager should have the method `context.is_tracing()`, which returns True if called within a program that is being traced or captured.

- `ops`: Path to the compiler operations module. This operations module may contain compiler specific versions of PennyLane operations. Within a JIT context, PennyLane operations may dispatch to these.

- `qjit`: Path to the JIT compiler decorator provided by the compiler. This decorator should have the signature `qjit(fn, *args, **kwargs)`, where `fn` is the function to be compiled.

* The compiler driver diagnostic output has been improved, and now includes failing IR as well as the names of failing passes. [(349)](https://github.com/PennyLaneAI/catalyst/pull/349)

* The scatter operation in the Catalyst dialect now uses an SCF for loop to avoid ballooning the compiled code. [(307)](https://github.com/PennyLaneAI/catalyst/pull/307)

* The `CopyGlobalMemRefPass` pass of our MLIR processing pipeline now supports dynamically shaped arrays. [(348)](https://github.com/PennyLaneAI/catalyst/pull/348)

* The Catalyst utility dialect is now included in the Catalyst MLIR C-API. [(345)](https://github.com/PennyLaneAI/catalyst/pull/345)

* Fix an issue with the AutoGraph conversion system that would prevent the fallback to Python from working correctly in certain instances. [(352)](https://github.com/PennyLaneAI/catalyst/pull/352)

The following type of code is now supported:

python
qjit(autograph=True)
def f():
l = jnp.array([1, 2])
for _ in range(2):
l = jnp.kron(l, l)
return l


<h3>Breaking changes</h3>

* The axis ordering for `catalyst.jacobian` is updated to match `jax.jacobian`. Assuming we have parameters of shape `[a,b]` and results of shape `[c,d]`, the returned Jacobian will now have shape `[c, d, a, b]` instead of `[a, b, c, d]`. [(283)](https://github.com/PennyLaneAI/catalyst/pull/283)

<h3>Bug fixes</h3>

* An upstream change in the PennyLane-Lightning project was addressed to prevent compilation issues in the `StateVectorLQubitDynamic` class in the runtime. The issue was introduced in [499](https://github.com/PennyLaneAI/pennylane-lightning/pull/499). [(#322)](https://github.com/PennyLaneAI/catalyst/pull/322)

* The `requirements.txt` file to build Catalyst from source has been updated with a minimum pip version, `>=22.3`. Previous versions of pip are unable to perform editable installs when the system-wide site-packages are read-only, even when the `--user` flag is provided. [(311)](https://github.com/PennyLaneAI/catalyst/pull/311)

* The frontend has been updated to make it compatible with PennyLane `MeasurementProcess` objects now being PyTrees in PennyLane version 0.33. [(315)](https://github.com/PennyLaneAI/catalyst/pull/315)

<h3>Contributors</h3>

This release contains contributions from (in alphabetical order):

Ali Asadi,
David Ittah,
Sergei Mironov,
Romain Moyard,
Erick Ochoa Lopez.

0.3.1post1

This post-release updates the docs to include the AutoGraph guide.

0.3.1

<h3>New features</h3>

* The experimental AutoGraph feature, now supports Python `for` loops, allowing native Python loops to be captured and compiled with Catalyst. [(258)](https://github.com/PennyLaneAI/catalyst/pull/258)

python
dev = qml.device("lightning.qubit", wires=n)

qjit(autograph=True)
qml.qnode(dev)
def f(n):
for i in range(n):
qml.Hadamard(wires=i)

return qml.expval(qml.PauliZ(0))


This feature extends the existing AutoGraph support for Python `if` statements introduced in v0.3. Note that TensorFlow must be installed for AutoGraph support.

* The quantum control operation can now be used in conjunction with Catalyst control flow, such as loops and conditionals, via the new `catalyst.ctrl` function. [(282)](https://github.com/PennyLaneAI/catalyst/pull/282)

Similar in behaviour to the `qml.ctrl` control modifier from PennyLane, `catalyst.ctrl` can additionally wrap around quantum functions which contain control flow, such as the Catalyst `cond`, `for_loop`, and `while_loop` primitives.

python
qjit
qml.qnode(qml.device("lightning.qubit", wires=4))
def circuit(x):

for_loop(0, 3, 1)
def repeat_rx(i):
qml.RX(x / 2, wires=i)

catalyst.ctrl(repeat_rx, control=3)()

return qml.expval(qml.PauliZ(0))


pycon
>>> circuit(0.2)
array(1.)


* Catalyst now supports JAX's `array.at[index]` notation for array element assignment and updating. [(273)](https://github.com/PennyLaneAI/catalyst/pull/273)

python
qjit
def add_multiply(l: jax.core.ShapedArray((3,), dtype=float), idx: int):
res = l.at[idx].multiply(3)
res2 = l.at[idx].add(2)
return res + res2

res = add_multiply(jnp.array([0, 1, 2]), 2)


pycon
>>> res
[0, 2, 10]


For more details on available methods, see the [JAX documentation](https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.ndarray.at.html).

<h3>Improvements</h3>

* A new compiler driver has been implemented in C++. This improves compile-time performance by avoiding *round-tripping*, which is when the entire program being compiled is dumped to a textual form and re-parsed by another tool.

This is also a requirement for providing custom metadata at the LLVM level, which is necessary for better integration with tools like Enzyme. Finally, this makes it more natural to improve error messages originating from C++ when compared to the prior subprocess-based approach. [(216)](https://github.com/PennyLaneAI/catalyst/pull/216)

* Support the `braket.devices.Devices` enum class and `s3_destination_folder` device options for AWS Braket remote devices. [(278)](https://github.com/PennyLaneAI/catalyst/pull/278)

* Improvements have been made to the build process, including avoiding unnecessary processes such as removing `opt` and downloading the wheel. [(298)](https://github.com/PennyLaneAI/catalyst/pull/298)

* Remove a linker warning about duplicate `rpath`s when Catalyst wheels are installed on macOS. [(314)](https://github.com/PennyLaneAI/catalyst/pull/314)

<h3>Bug fixes</h3>

* Fix incompatibilities with GCC on Linux introduced in v0.3.0 when compiling user programs. Due to these, Catalyst v0.3.0 only works when clang is installed in the user environment.

- Resolve an issue with an empty linker flag, causing `ld` to error. [(276)](https://github.com/PennyLaneAI/catalyst/pull/276)

- Resolve an issue with undefined symbols provided the Catalyst runtime. [(316)](https://github.com/PennyLaneAI/catalyst/pull/316)

* Remove undocumented package dependency on the zlib/zstd compression library. [(308)](https://github.com/PennyLaneAI/catalyst/pull/308)

* Fix filesystem issue when compiling multiple functions with the same name and `keep_intermediate=True`. [(306)](https://github.com/PennyLaneAI/catalyst/pull/306)

* Add support for applying the `adjoint` operation to `QubitUnitary` gates. `QubitUnitary` was not able to be `adjoint`ed when the variable holding the unitary matrix might change. This can happen, for instance, inside of a for loop. To solve this issue, the unitary matrix gets stored in the array list via push and pops. The unitary matrix is later reconstructed from the array list and `QubitUnitary` can be executed in the `adjoint`ed context. [(304)](https://github.com/PennyLaneAI/catalyst/pull/304) [(#310)](https://github.com/PennyLaneAI/catalyst/pull/310)

<h3>Contributors</h3>

This release contains contributions from (in alphabetical order):

Ali Asadi,
David Ittah,
Erick Ochoa Lopez,
Jacob Mai Peng,
Sergei Mironov,
Romain Moyard.

Page 10 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.