# ZW-calculus **ZW-calculus** is a graphical language for quantum computation, closely related to [[zx-calculus]], built around a third kind of node (the W-spider) alongside the usual green Z-spider. It was introduced to natively represent the GHZ and W entangled states, two three-qubit states that are inequivalent under local operations but which ZX-calculus can only express clumsily. The W-spider encodes exactly the branching structure of the W state, where entanglement is spread evenly across qubits rather than concentrated as in a GHZ state. This makes ZW-calculus a more natural fit for reasoning about entanglement classes and multipartite entanglement structure than ZX-calculus. ``` W-spider: GHZ-like Z-spider: | | | | | | \ | / \ | / (W) (Z) ``` ## Fermionic extensions ZW-calculus has also been extended to represent fermionic quantum computation directly, since the W-spider's algebra maps naturally onto fermionic creation and annihilation operators. This makes it a useful tool for simulating fermionic systems (relevant to quantum chemistry) without first performing a costly Jordan-Wigner-style mapping to qubits. ## Relationship to ZX-calculus ZW-calculus and ZX-calculus can be translated into each other, since both are complete graphical languages for quantum mechanics, but each makes different structure easy to see. ZX-calculus is generally preferred for circuit optimization and stabilizer reasoning, while ZW-calculus is preferred when the entanglement structure itself, rather than the circuit, is the object of study.