# Inverse of UnitDimensions[]

Is there a straightforward way to write an inverse of UnitDimensions to get the SI unit from dimensions?

For example,

inverseUnitDimensions[{{"LengthUnit", 1}, {"MassUnit", 1}, {"TimeUnit", -2}}]


should return "Newtons".

• Slightly off-topic: Here's an automatic "unit simplifier" solution: mathematica.stackexchange.com/a/211950/26598: unitSimplify[Quantity[1, "Meters" "Kilograms"/"Seconds"^2], Join[SIbase, SIderived]] returns {Quantity[1, "Newtons"]} as desired. Commented Jul 23 at 9:23

You can use QuantityVariableCanonicalUnit:

QuantityVariableCanonicalUnit[QuantityVariable[
{{"LengthUnit", 1}, {"MassUnit", 1}, {"TimeUnit", -2}}]]
(* ("Kilograms" "Meters")/("Seconds")^2 *)


Now you need a combination of UnitSimplify and UnitConvert:

QuantityUnit[UnitConvert[UnitSimplify[Quantity[1, %]], "SI"]]
(* "Newtons" *)

• Thanks. That's just what I hoped for. I wish Wolfram documentation would make better use of "See Also." The first time I saw QuantityVariableCanonicalUnit[] was in your answer. Commented Jul 22 at 17:34

In[16]
si[dimensions_]:=
UnitSimplify[
UnitConvert[
QuantityVariableCanonicalUnit[
QuantityVariable[dimensions]],
"SI"]]

si[{{"LengthUnit", 1}, {"MassUnit", 1}, {"TimeUnit", -2}}]
si[{{"ElectricCurrentUnit", 1}, {"TimeUnit", 1}}]

Out[17]= Quantity[1, "Newtons"]

Out[18]= Quantity[1, "Coulombs"]