Releases: quantumlib/Qualtran
Qualtran v0.5
This preview release of Qualtran contains many improvements and new bloqs.
This is the last planned release before the 1.0 release of Qualtran. 1.0 will bring stronger stability guarantees to the core Qualtran framework: namely everything in the qualtran
namespace outside of qualtran.bloqs
. The library of bloqs
will continue to be extended and edited for greater breadth and accuracy. This development release contains some backwards-incompatible changes to prepare for 1.0. Read on for more information
Bartiq and QREF integration
This release includes interoperability with Bartiq via the QREF format implemented by @mstechly in #1194. Interoperability between quantum algorithms tooling is crucial to accelerate progress in the field.
Qualtran software paper
We've authored a manuscript describing the design of Qualtran, some important algorithmic primitives contained in qualtran.bloqs
, and case studies on problems of interest. If you use Qualtran in your own work, please cite:
Expressing and Analyzing Quantum Algorithms with Qualtran. arXiv:2409.04643.
Gate counting and leaf bloqs
We've unified the gate counting framework under the qualtran.resource_counting
framework.
- The
_t_complexity_
annotation is deprecated. Please continue to annotate callees withbuild_call_graph
or usemy_static_costs
to provide a static override. - The
cirq_interop.t_complexity
function no longer uses any custom logic. Rather, it goes viaqualtran.resource.estimation
tools; specifically theQECGatesCost
cost key. There should be no observable change to the computed costs. #1313 #1359 #1323 #1333 Toffoli
is now an atomic, leaf bloq #1388CSwap
is now an atomic leaf bloq #1393And
will become an atomic leaf bloq #1347- The
GraphvizCallGraph.from_bloq
helper method can draw call graphs with costs #1254
Tensor simulation overhaul
The tensor simulation protocol was changed to support efficient simulation of a larger class of circuits, including shallow-but-wide circuits. Qualtran can simulate a 2x32-qubit adder using only 6 qubit's worth of RAM for a specific input/output ket following the changes.
- Overhaul implemented in #1070. Tensor simulation will always try to flatten as much as possible before starting the contraction. The semantics of
my_tensors
have changed. If you are overriding this method to support tensor simulation, consider relying directly on the decomposition or read the documentation for full details on how to implement the new method. - Changes to
.flatten
in #1061. Flattening will no longer raise an error if a bloq doesn't have a decomposition..flatten()
with no arguments will flatten as much as possible.
Physical cost models
The qualtran.surface_code
module has been refactored so both Beverland- and Gidney-derived models follow the same interface.
- Code changes in #1141 #1154 #1157 #1183 #1185
qualtran.resource_estimation.GateCounts
is used directly.AlgorithmSummary
andMagicCount
dataclasses have been removed as redundant.
Other framework changes
- The
bit_tools
module has been removed and replaced withQDType
features by @charlesyuan314 in #1041. Please migrate your code to useQDType
methods to convert between bits. New, vectorizedfrom_bits
andto_bits
by @anurudhp in #1199 - Greedy topological sort of the binst graph to minimize qubit allocations / deallocations by @tanujkhattar in #1099
- Cirq interop overhaul/bugfixes @tanujkhattar in #1100
- QFxp: use integer values for classical sim instead of
fxpmath.Fxp
by @anurudhp in #1204 - Change return type of build_call_graph to set | dict by @dstrain115 in #1356 #1392
pretty_name
is deprecated #1340. Use__str__
.Bloq.supports_decompose_bloq
has been removed in #1382. Usetry/except
.BoundedQUInt
has been renamed toBQUInt
by @fdmalone in #1363- Better support for symbolics in
Signature
by @anurudhp in #1353 and @mpharrigan in #1301 - param
ctrl_spec
ofget_ctrl_system
will always be non-None by @anurudhp in #1209 - Zero-bitsize connections are explicitly not allowed by @mpharrigan in #1105
New and updated bloqs
- Implement decomposition for
BitonicSort
by @anurudhp in #1089 - Add
AutoPartition
andBloqBuilder.add_and_partition
to fit bloqs together whose registers don't quite match by @charlesyuan314 in #1086 - Implement classical action of Cast bloq by @NoureldinYosri in #1093
- Add
Unitary
andTensorProduct
block encodings by @charlesyuan314 in #1094 - GlobalPhase: use
exponent
, and implement controlled (ZPowGate) by @anurudhp in #1117 - Create
ApplyLthBloq
as a simple SELECT oracle by @charlesyuan314 in #1107 - Add
Product
block encoding by @charlesyuan314 in #1106 - Add
Phase
block encoding by @charlesyuan314 in #1129 - Add
LinearCombination
block encoding by @charlesyuan314 in #1133 - Permutation Bloq by @anurudhp in #1110
- Sparse state preparation via alias sampling by @anurudhp in #1067
- Implement
Negate
(two's complement) by @anurudhp in #1144 - Add
Xor
bloq by @charlesyuan314 in #1149 - Add
InvertRealNumber
bloq by @charlesyuan314 in #1151 - Add
BitwiseNot
by @anurudhp in #1161 - Add
SubtractFrom
to subtract from a register in place by @charlesyuan314 in #1158 - Switch
SubtractFrom
to useBitwiseNot
by @charlesyuan314 in #1164 - Create
SparseMatrix
block encoding by @charlesyuan314 in #1143 - Optimize gate count of Subtract to n-1 Toffolis by @NoureldinYosri in #1057
- CHadamard by @mpharrigan in #1114
- CYGate by @mpharrigan in #1115
- CZ by @mpharrigan in #1116
- Disallow zero sized registers in QROMs and PRGAViaPhaseGradient by @tanujkhattar in #1160
- Add
ExplicitEntryOracle
to block encode a matrix by @charlesyuan314 in #1166 ControlledAddOrSubtract
Bloq by @anurudhp in #1145- Update classical action of addition gates and fix classical action bug in Join by @NoureldinYosri in #1174
- Implement generic
MultiControlledBloq
using single-controlled subbloq + And ladder. by @anurudhp in #1155 ControlledViaAnd
tests and bloq examples by @anurudhp in #1182- Add
SignExtend
for two's complement sign extension by @anurudhp in #1162 - Add
SymmetricBanded
matrix block encoding by @charlesyuan314 in #1177 - Add
ArcSin
bloq by @charlesyuan314 in #1188 - Add symbolic call graph for
SparseMatrix
by @charlesyuan314 in #1193 - Revamp
ChebyshevPolynomial
by @charlesyuan314 in #1213 - Bitwise bloqs are self adjoint by @anurudhp in #1220
- Update QROAM in chemistry prepare bloqs to use clean ancilla by @fdmalone in #1226
- Add
ScaledChebyshevPolynomial
bloq by @charlesyuan314 in #1231 - Add an optimizer for
LinearCombination
s by @charlesyuan314 in #1232 - Add FFT QSP by @Epsilon1024 in #1078
- RzViaPhaseG...
Qualtran v0.4
We're pleased to announce the latest beta release of Qualtran: v0.4.0. This release includes many improvements and fixes throughout the library, but some highlights include:
Highlights
- Support for arbitrary
CostKey
s: compute gate counts, qubit counts, or define your own cost - Many more bloqs support symbolic parameters and cost estimates
- Bugfixes for using Qualtran on Windows
- Better control for how bloqs display themselves in diagrams
- Mypy type-checking is enabled and enforced library-wide.
Full Changelog: v0.3.0...v0.4.0
Qualtran v0.3.0
This is an incremental beta release of Qualtran.
Highlights
- Quantum data types. Registers now have types.
- T-complexity protocol improvements.
- More bloqs!
Full Changelog: v0.2.0...v0.3.0
Qualtran v0.2.0
This is an incremental beta release of Qualtran.
Highlights include:
- Improved Cirq interoperability, and the absorption of the-package-formerly-known-as Cirq-FT into the Qualtran repository.
- More chemistry bloqs.
- The Adjoint protocol
Full Changelog: v0.1.0...v0.2.0
Qualtran v0.1.0
This is the initial, experimental preview release of Qualtran