import { CPList } from "@masabando/quantum-gates"CPList is a predefined collection of composite pulse (CP) sequences. Each entry describes how a target rotation (θ, φ) is decomposed into a sequence of robust pulses.
Each entry in CPList is an object with the following structure.
type CP = { name: string robustType?: "ple" | "ore" | "both" rep?: "ple" | "ore" | false pulse: Pulse[]}/* Each pulse element */type Pulse = { theta: (_theta: number, _phi: number) => number phi: (_theta: number, _phi: number) => number canReduce?: boolean}The following composite pulses are available by default. Some entries (e.g. CORPSE/BB1) are generated programmatically by createCCCP.
plainBB1SK1CORPSEshortCORPSECORPSE/SK1SK1/CORPSECORPSE/BB1BB1/CORPSEreduced CORPSE/SK1reduced CORPSE/BB1CPList is typically passed to higher-level utilities such as gate construction or visualization tools. Users normally select a composite pulse by its key.
import { CPList } from "@masabando/quantum-gates"const cp = CPList["BB1"]console.log(cp.name)console.log(cp.pulse.length)createCCCP creates a new composite pulse by concatenating two existing composite pulses in CPList.
import { createCCCP } from "@masabando/quantum-gates"const cp = createCCCP("CORPSE", "BB1")console.log(cp.name)console.log(cp.robustType)console.log(cp.rep)console.log(cp.pulse.length)When reduced is set to true, elements in the second pulse marked with canReduce are kept as-is instead of being expanded.
theta and phi are evaluated dynamically for a given target rotation.canReduce. When reduced=true, elements in the second pulse marked with canReduce are not expanded during concatenation.CPList directly.