We build a symmetric monoidal and compact closed bicategory by combining
spans and cospans inside a topos. This can be used as a framework in which to
study open networks and diagrammatic languages. We illustrate this framework
with Coecke and Duncan's zx-calculus by constructing a bicategory with the
natural numbers for 0-cells, the zx-calculus diagrams for 1-cells, and rewrite
rules for 2-cells.Comment: In Proceedings QPL 2017, arXiv:1802.0973