Skip to main content

Tools for generating pictures for various D-Wave topologies

Project description

d-wave tikz: tools for generating TikZ pictures of various D-Wave topologies

What is this??

A collection of Python-based command line utilities that can generate standalone LateX documents with TikZ pictures of all currently available D-Wave annealers' topologies. The pictures contain minimum styling and should serve only for defining the "skeleton" of the graph.

The generated pictures heavily utilize TikZ styles, so you can adjust the looks of the pictures by tweaking style definitions at the very beginning of your TikZ picture.

What is this not?

The dwave-tikz is not designed for producing pretty pictures. Yes, it contains basic styling, but the assumption is that you tweak the style definition in the produced .tex file. Writing a comprehensive CLI allowing one to control every single aspect of TikZ picture would be time consuming beyond the point of being useful.

Installation

Python >= 3.8 is required. Other Python dependencies will be downloaded during installation. The --compile flag assumes that latexmk is available in your PATH variable.

To install the latest version just run:

pip install dwave-tikz

This should install the dwavetikz script in your path. To verify, run

dwavetikz -h

Usage

The CLI invocation looks as follows:

dwavetikz <topology> <size> [options] 

Some options are common to all topologies, others are specific to only given topology. Anyway, you can always run

dwavetikz <topology> -h

to learn about all arguments available for given topology (both common and specific). For instance, dwavetikz pegasus -h will give you all available options for pegasus topoloy.

By default, the output is printed to stdout. You can either redirect it as usually, or use --output parameter to provide a file name.

Additionally, if --compile flag is provided, an attempt will be made to compile the output .tex file. Obviously, this only works in conjunction with --output flag.

Examples

Warning If you are using dark Github theme, the SVG pictures presented in this section may look slightly unreadable, because they have transparent backgrounds.

Example 1: simple C2 Chimera, output to chimera.tex

dwavetikz chimera 2 --output chimera.tex

chimera

Example 2: the same Chimera, but with labels.

dwavetikz chimera 2 --output chimera2.tex --with-labels

chimera

Example 3: the same Chimera, with labels, and after changing styles.

dwavetikz chimera 2 --output chimera3.tex --with-labels

The styles were modified as follows (relevant part of chimera3.tex):

\begin{tikzpicture}[
        scale=1,
        coupler/.style={draw},
        qubit/.style={
            circle, line width=2pt, font={\large \bfseries}, fill=White,draw=darkgray,minimum size=7mm, inner sep=0.5mm
        },
        hidden/.style={opacity=0.0},
        internal/.style={color=RoyalBlue, ultra thick, dashed},
        external/.style={color=Tan, ultra thick},
    ]

chimera

Example 4: Chimera with 2 rows, 3 columns and nonstandard shore size of 8 (unit cells of such Chimera are ports of the Zephyr topology). It also uses larger scaling of coordinates to spread out nodes further away from each other (otherwise the nodes would overlap).

dwavetikz chimera 2 -n 3 -t 8 --output chimera4.tex --scale 40 --compile

chimera

Example 5: The P3 Pegasus using the default L-layout for Chimera unit cells.

dwavetikz pegasus 3 --output pegasus.tex

pegasus

Example 6: The P3 Pegasus using the cross layout for Chimera unit cells.

dwavetikz pegasus 3 --cross --output pegasus2.tex

pegasus

Example 7: The Z3 Zephyr graph.

dwavetikz zephyr 3 --cross --output zephyr.tex

zephyr

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwave-tikz-0.0.2.tar.gz (147.1 kB view details)

Uploaded Source

Built Distribution

dwave_tikz-0.0.2-py3-none-any.whl (152.2 kB view details)

Uploaded Python 3

File details

Details for the file dwave-tikz-0.0.2.tar.gz.

File metadata

  • Download URL: dwave-tikz-0.0.2.tar.gz
  • Upload date:
  • Size: 147.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dwave-tikz-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38bc6b7976ed0e820e607ad8947b543bc4d75fa0aa02ba3bfba9ba0ecc9c1e85
MD5 2b8ae642a5d5528edc1b55325da12d90
BLAKE2b-256 f15d3f71f96c79c2c871d52905d26da503cc0a025729f0965def5b02b02b2986

See more details on using hashes here.

File details

Details for the file dwave_tikz-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dwave_tikz-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 152.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dwave_tikz-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b208848125e6c07afe56a2af370db563299b5edab9f6aa7894c162ede7a9565a
MD5 6ccaa22c45f7bdd4812feffbf2488733
BLAKE2b-256 178ec31e807fcd60f44c15e6d276f99eaf528d628d7c38462bd32e95f79541a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page