Tensorcircuit

Latest version: v0.12.0

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

Scan your dependencies

Page 2 of 6

0.7.0

Added

- Add `c.probability()` method to return probability amplitude

- Add results module including funtionalities on count dict manipulation and readout error mitigation (local/global calibriation, scalable counts and expectation mitigation from research papers)

- Add `_extra_qir` to store information on hardware level measurement and reset

- Add `enable_instruction` option in `to_qiskit` method that enables measurements in qiskit export

- Add circuit method `measure_instruction`, `barrier_instruction` and `reset_instruction` for hardware level
instruction flags

- Auto unroll composite qiskit instructions when translating to tc circuit

- Add `binding_parameters` argument for translating parameterized qiskit circuit to tc circuit

- Add `keep_measure_order` bool option to `from_openqasm` methods so that the measure instruction order is kept by qiskit

- Add Chinese translation for doc Sharpbit

- Add `circuit_constructor` argument for `qiskit2tc` method, so that we can support more circuit class than circuit and dmcircuit

Fixed

- Fix adjoint possible bug with agnostic backend

- Fix `sigmoid` bug on pytorch backend

- Fix `relu` bug on pytorch backend

- Ignore ComplexWarning for `cast` method on numpy and jax backend

- Fix `vjp` method bug on tensorflow backend, where none is replaced with zeros

0.6.0

Added

- Add native support for `rxx`, `ryy` and `rzz` gates for translation from qiskit

- Add `from_openqasm` and `from_openqasm_file` methods for `Circuit`

- Add `circuit_params` argument for translation from qiskit to make the interface universal and consistent with other `from_` methods

- Add `shifts` tuple parameter for `experimental.parameter_shift_grad` API so that we can also customize finite difference gradient from this method

- Add `std` method for backends

- Add `NoiseModel` class to programmably configure the global error model when simulating the quantum circuit

- Add `tc.channels.composedkraus` to compose the different Kraus operators as a new one

- Add direct support for noise model via `sample_expectation_ps` and `expectation` methods, both Monte Carlo trajectory and density matrix evolution approaches are supported

Changed

- Improve the efficiency of `sample_expectation_ps` method by using cached state

Fixed

- Fixed `unitary_kraus` of Circuit class support for multi-qubit kraus channels, previous implementation fails to reshape the multi-qubit kraus tensor as matrix

- Fixed `kraus_to_super_gate` bug when multi-qubit kraus channels are presented on tensorflow backend

0.5.0

Added

- Finished quantum noise modeling and simulation development stage 1. Add more quantum channels and the differentiable transformation between different channel forms. Add readout error support for sample and sample_expectation_ps methods.

- Add new parameter shift gradient API that supports finite measurement shots and the corresponding example scripts

- Add openqasm format transformation method `c.to_openqasm()`

- Add native support for `phase` and `cphase` gates when transforming to qiskit

- Add native support for `rxx`, `ryy`, `rzz` and `u`, `cu` gates when transforming to qiskit

- Add native support for `u` gate when transforming from qiskit

- Add circuit `from_qsim_file` method to load Google random circuit structure

- Add `searchsorted` method for backend

- Add `probability_sample` method for backend as an alternative for `random_choice` since it supports `status` as external randomness format

- Add `status` support for `sample` and `sample_expection_ps` methods

Changed

- The inner mechanism for `sample_expectation_ps` is changed to sample representation from count representation for a fast speed

Fixed

- Fixed the breaking change introduced in jax 0.3.18, `jax._src` is no longer imported into the from the public jax namespace.

- `tc.quantum.correlation_from_samples` now fix the sign error with odd number of spins

- Updated to the latest version of mypy and get rid of lots of type: ignored

- Fix the dtype bug when float is pass to u gate or phase gate

- Fix to qiskit bug when parameterized gate has default nonset parameters

- Fix `iswap` gate translation to qiskit with support for parameters

0.4.1

Added

- Add support for weighted graph QAOA in `tc.templates.blocks.QAOA_block`

- Add `AbstractCircuit` to and from json capability (experimental support, subject to change)

- Add alias for `sd` and `td` gate

- Add `phase` gate and `cphase` gate for the circuit

- Add U gate and CU gate following OpenQASM 3.0 convention

- Add `tc.gates.get_u_parameter` to solve the three Euler angle for the U gate given the matrix

- Add `GateVF.ided()` method to kron quantum gate with identity gate

- Add `batched_parameters_structures.py` example to demonstrate nested vmap and architecture search possibility

- Add `gate_count` method on `AbstractCircuit` to count gates of given type in the circuit

- Add `gate_summary` method on `AbstractCircuit` to count gate by type as a dict

- Add ccx as another alias for toffoli gate

Changed

- Seperate channel auto register for circuit class with unitary and general case

- The old standalone depolarizing implementation can now be called via `c.depolarizing_reference`

Fixed

- Move `iswap` gate to vgates list

- Fix possible bug when vmap is nested in different order (only affect tensorflow backend)

- Fix bug when multi input function accept the same variable in different args and gradient or jvp/vjp is required (only affect tensorflow backend)

- Fix the use of rev over rev jacobian for hessian method and back to the efficient solution of fwd over rev order due to the solution of nested vmap issue on tf backend

- Identify potential bug in `unitary_kraus2` implementation, change to `unitary_kraus` instead

0.4.0

Added

- Add `sample_expectation_ps` method for `BaseCircuit`, which measure the Pauli string expectation considering measurement shots

- Add alias `expps` for `expectation_ps` and `sexpps` for `sampled_expectation_ps`

- Add `counts_d2s` and `counts_s2d` in quantum module to transform different representation of measurement shots results

- Add vmap enhanced `parameter_shift_grad` in experimental module (API subjects to change)

- Add `parameter_shift.py` script in examples showcasing how to use parameter shift grad wrapper

- Add `vmap_randomness.py` script in examples showcasing how to vmap external random generators

- Add `noise_sampling_jit.py` script showcasing how real device simulation with sample method is efficiently implemented with Monte Carlo and jit

- Add jit support and external random management for `tc.quantum.measurement_counts`

- Add MPO gate support for multiple qubit gates in `MPSCircuit` simulator

- Add the `expectation_ps` method to `MPSCircuit` (moving to `AbstractCircuit`)

- Add six format of measurement results support and their transformation in quantum module

- Add format option in `Circuit.sample` while maintain the backward compatibility

- Add `tc.utils.arg_alias` which is a decorator that adds alias argument for function with the doc fixed accordingly

- Add quantum channel auto resgisteration method in `Circuit` class

Changed

- `rxx`, `ryy`, `rzz` gates now has 1/2 factor before theta consitent with `rx`, `ry`, `rz` gates. (breaking change)

- replace `status` arguments in `sample` method as `random_generator` (new convention: status for 0, 1 uniform randomness and random_generator for random key) (breaking change)

- Rewrite the expectation method of `MPSCircuit` to make it general

- Adjusted the initialization method for `MPSCircuit` (move the from_wavefunction method and allow QuVector input) (breaking change)

- `tc.quantum.measurement_counts` aliased as `tc.quantum.measurement_results` and change the function arguments (breaking change)

- Refactor backend to use multiple inheritance approach instead of reflection method

Fixed

- Add jit support for `sample` method when `allow_state=True`

- Fix the bug that 128 type is converted to 64 value

- Fix `arg_alias` bug when the keyword arguments is None by design

- Fix `arg_alias` when the docstring for each argument is in multiple lines

- Noise channel apply methods in `DMCircuit` can also absorb `status` keyword (directly omitting it) for a consistent API with `Circuit`

0.3.1

Added

- Add overload of plus sign for TensorFlow SparseTensor

- Add support of dict or list of tensors as the input for `tc.KerasLayer`

- Add support of multiple tensor inputs for `tc.TorchLayer`

- Both gate index and `expectation(_ps)` now support negative qubit index, eg. `c.H(-1)` with the same meaning as numpy indexing

- Add `tc.templates.measurements.parameterized_local_measurements` for local Pauli string evaluation

Changed

- Change pytest xdist option in check_all.sh to `-n auto`

- Further refactor the circuit abstraction as AbstractCircuit and BaseCircuit

Fixed

- Add `sgates`, `vgates`, `mpogates` and `gate_aliases` back to `BaseCircuit` for backward compatibility

- Add auto conversion of dtype for `unitary` gate

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.