tensorcircuit.symbolgates¶

Symbolic gate matrix factories using sympy.

These return Gate objects containing numpy object arrays with sympy expressions, compatible with tn.Node and the tc.contractor contraction pipeline.

Convention: for an n-qubit gate, the tensor is shaped [2]*2n with the first n axes being output legs and the last n axes being input legs, matching the Gate convention in tensorcircuit.

tensorcircuit.symbolgates.sym_any(unitary: Any = None, **kws: Any) Gate[source]¶

Symbolic ‘any’ gate from a unitary matrix. Extra keyword arguments are ignored (compatibility with delayed apply).

tensorcircuit.symbolgates.sym_cnot() Gate[source]¶
tensorcircuit.symbolgates.sym_cphase(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_cr(theta: Any = 0, alpha: Any = 0, phi: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_crx(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_cry(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_crz(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_cu(theta: Any = 0, phi: Any = 0, lbd: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_cy() Gate[source]¶
tensorcircuit.symbolgates.sym_cz() Gate[source]¶
tensorcircuit.symbolgates.sym_fredkin() Gate[source]¶
tensorcircuit.symbolgates.sym_h() Gate[source]¶
tensorcircuit.symbolgates.sym_i() Gate[source]¶
tensorcircuit.symbolgates.sym_iswap(theta: Any = 1) Gate[source]¶
tensorcircuit.symbolgates.sym_orx(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_ory(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_orz(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_ox() Gate[source]¶
tensorcircuit.symbolgates.sym_oy() Gate[source]¶
tensorcircuit.symbolgates.sym_oz() Gate[source]¶
tensorcircuit.symbolgates.sym_phase(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_r(theta: Any = 0, alpha: Any = 0, phi: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_rx(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_rxx(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_ry(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_ryy(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_rz(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_rzz(theta: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_s() Gate[source]¶
tensorcircuit.symbolgates.sym_sd() Gate[source]¶
tensorcircuit.symbolgates.sym_swap() Gate[source]¶
tensorcircuit.symbolgates.sym_t() Gate[source]¶
tensorcircuit.symbolgates.sym_td() Gate[source]¶
tensorcircuit.symbolgates.sym_toffoli() Gate[source]¶
tensorcircuit.symbolgates.sym_u(theta: Any = 0, phi: Any = 0, lbd: Any = 0) Gate[source]¶
tensorcircuit.symbolgates.sym_wroot() Gate[source]¶
tensorcircuit.symbolgates.sym_x() Gate[source]¶
tensorcircuit.symbolgates.sym_y() Gate[source]¶
tensorcircuit.symbolgates.sym_z() Gate[source]¶