mc-zen / quill Goto Github PK
View Code? Open in Web Editor NEWEffortlessly create quantum circuit diagrams in Typst.
Home Page: https://typst.app/universe/package/quill
License: MIT License
Effortlessly create quantum circuit diagrams in Typst.
Home Page: https://typst.app/universe/package/quill
License: MIT License
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 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$), [\ ],
)
})
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)
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,
)
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.
I can use lstick instead, but in that case, the kets and dots are not aligned.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.