You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to_graph_like no longer drops a Hadamard on a wire that connects an input directly to an output. It replaced such an edge with a chain equal to the identity regardless of the edge type, so a qubit that reduced to a single H (e.g. after full_reduce) lost it, and the extracted circuit and GeneticOptimizer results were wrong. (by @0xrichardlu)
tensorfy with a rank-width strategy no longer raises an OverflowError or returns 0 when the diagram's scalar or the contracted tensor is outside the float range but their product is not, as can happen for large closed diagrams. The contraction now keeps the power of two in a separate integer, and the scalar is converted the same way, so they are only combined at the end. preserve_scalar=False no longer evaluates the scalar at all (#575) (by @gauthamkanagaraj).
Added
PauliExponential circuit gate for Pauli rotations on specified qubits. (by @pmitos)
Fixed
Circuit.adjoint now adjoints the inner gate of a ConditionalGate, so if(c==1) s q[0]; becomes if(c==1) sdg q[0];. (by @anubhavlal07)
Corrected scalar evaluation for opposite non-Clifford spider phases by converting pi units to radians in Scalar.add_spider_pair.
graph_to_circuit and parse_quipper_block now add XCX gates correctly instead of raising KeyError: 'CX', and "CX" is registered as an alias for CNOT in gate_types and exported in pyzx.circuit.
Circuit.from_qasm now reads phases written with the OpenQASM 3 π constant, such as rz(π/4), as multiples of π instead of dividing them by π a second time. (by @anubhavlal07)
The graph-like matchers check_lcomp, check_pivot, check_pivot_boundary, and check_pivot_gadget now properly check that the neighbourhoods of the selected vertices are graph-like.
The graph-like check used by these matchers (utils.is_subgraph_graph_like) now only looks at the edges of the subgraph instead of at every pair of its vertices, and check_lcomp checks the phase of the vertex before checking its neighbourhood. This removes the 2-3x slowdown of full_reduce that the stricter matchers caused; the results are unchanged. (by @KainanP)
generate.phase_poly_from_gadgets no longer raises TypeError for numpy integer parities, and caps n_gadgets at the number of available parities instead of raising ValueError (#589). (by @0xrichardlu)
FSim.to_adjoint now raises NotImplementedError instead of returning the gate unchanged, so Circuit.adjoint and Circuit.verify_equality no longer silently give wrong results for circuits containing FSim (#587). (by @0xrichardlu)
teleport_reduce no longer changes the semantics of circuits with non-Clifford phases that are not multiples of pi/4 (e.g. pi/8): when a phantom non-Clifford phase was re-fused, Simplifier.fuse_phases lost its sign (#586). (by @0xrichardlu)