Rewrite Rulesphysics/derivative-to-dv

physics/derivative-to-dv

Collapse derivative to the compact dv command.

Rewrite patterns#

  1. derivative-two-args\derivative{#1}{#2}\dv{#1}{#2}
  2. derivative-star\derivative*{#1}{#2}\dv*{#1}{#2}
  3. derivative-order\derivative[#1]{#2}{#3}\dv[#1]{#2}{#3}
  4. derivative-single-arg\derivative{#1}\dv{#1}

Examples#

Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.

dv alias embedded#

Before

F=m\derivative{x}{t}

After this rule

F=m\dv{x}{t}

Rendering verified with the declared packages.

derivative field alias#

Before

\derivative{\phi}{x}=0

After this rule

\dv{\phi}{x}=0

Rendering verified with the declared packages.

derivative star alias#

Before

\derivative*{x}{t}

After this rule

\dv*{x}{t}

Rendering verified with the declared packages.

derivative order alias#

Before

\derivative[n]{x}{t}

After this rule

\dv[n]{x}{t}

Rendering verified with the declared packages.

derivative single arg alias#

Before

\derivative{x} f(x)

After this rule

\dv{x} f(x)

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

Alias rewrite: derivative and dv share the same physics Derivative handler and argspec, so star, optional order, and one-argument forms are preserved by renaming the command.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["physics/derivative-to-dv"])
new TransformEngine({ profile: 'corpus', disableRules: ['physics/derivative-to-dv'] })

Open in Playground