Coder Social home page Coder Social logo

mc-zen / quill Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 2.0 2.68 MB

Effortlessly create quantum circuit diagrams in Typst.

Home Page: https://typst.app/universe/package/quill

License: MIT License

Typst 100.00%
drawing library quantum quantum-circuits typst

quill's Issues

Gallery contains false information

The gallery shows the typst instruction of the multi-qubit unitary gate as mqgate($U$, 3). It should be mqgate($U$, n : 3). The code below does not compile.

#import "@preview/quill:0.2.1": *

#quantum-circuit(
    lstick($|0〉$), mqgate($U$, 4), [\ ], 
    lstick($|0〉$), 1, [\ ],
    lstick($|0〉$), 1, [\ ],
    lstick($|0〉$), 1, [\ ],
)

A slice with a midstick on top of it has a background

A slice with a background color, combined with a midstick, will have an extra background color.

Minimal example:

#import "@preview/quill:0.2.0" : *
#quantum-circuit({
  let group = gategroup.with(stroke: (dash: "dotted", thickness: 1pt), fill: aqua)
  quantum-circuit(
    row-spacing: 6pt,
    column-spacing: 16pt,
    group(2, 1, label: "Wow"), $H$, [\ ],
    setwire(0), midstick($dots.v$), [\ ],
  ) 
})

image

Workaround: redefine draw-unboxed-gate and midstick.

  let draw-unboxed-gate(gate, draw-params) = box(
    inset: draw-params.padding, 
    fill: if gate.fill != none {gate.fill} else { none }, 
    gate.content
  )
  let midstick(content, label: none) = gate(content, draw-function: draw-unboxed-gate, label: label)

lstick content with equation numbering when turned on

When equation numbering is turned on, the content of lstick and rstick gets an equation number, even if there are no spaces in the expression $...$.

A minimum example is

#import "@preview/quill:0.2.1": *

#set math.equation(numbering: "(1)",supplement:[])

#quantum-circuit(
  lstick($rho_"AR"$, n:2), 1, [\ ],
  1, 1,
)

producing
image

make midstick behavior similar to lstick and rstick

Hello, thanks for this great package.

I have some trouble with midstick and fill color. I have set the option

#quantum-circuit(
    fill: accent-color,
    midstick($ket(Omega_1)$),
    mqgate($hat(U)(tau_1, hat(P)_1)$, n: 4),
    ...

)

As you can see, the labels from midstick are filled with a red background which I would prefer to avoid.

screenshot_02282024_09_44_53

I can use lstick instead, but in that case, the kets and dots are not aligned.

screenshot_02282024_09_49_11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.