Skip to content

Add sqrt flux and sqrt power.#91

Open
DanielSank wants to merge 2 commits into
quantumlib:mainfrom
DanielSank:add_root_flux
Open

Add sqrt flux and sqrt power.#91
DanielSank wants to merge 2 commits into
quantumlib:mainfrom
DanielSank:add_root_flux

Conversation

@DanielSank

Copy link
Copy Markdown

These are useful in the analysis of microwave circuits where we deal with "power waves" having dimensions of square root of power.

I need some help with how to update units_with_dimensions.py.

These are useful in the analysis of microwave circuits where
we deal with "power waves" having dimensions of square root of
power.
@NoureldinYosri

NoureldinYosri commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

overall looks good, but can SqrtFlux be renamed something more specific (maybe SqrtFrequencyFlux). for example there are already dimensions for MagneticFlux and LuminousFlux?

you do need to update tunits/core/__init__.py and tunits/core/__init__.pyi

also do you want to add $\sqrt{Hz}$ to the units files?

@DanielSank

Copy link
Copy Markdown
Author

can SqrtFlux be renamed something more specific (maybe SqrtFrequencyFlux). for
example there are already dimensions for MagneticFlux and LuminousFlux?

"Flux" means "something per time", which is why I didn't put any other words in the name. I think "Frequency" would be misleading because of the famous confusion between cyclic frequency, angular frequency, and oscillation period. Of course I'd be happy to find another name, I just haven't thought of one. Any suggestions?

you do need to update tunits/core/init.py and tunits/core/init.pyi

Thanks. Done.

also do you want to add sqrt(Hz)?

Not sure what that means. Please explain.

@NoureldinYosri

Copy link
Copy Markdown
Collaborator

I'd be happy to find another name

I think a better name would make the class name more informative

Not sure what that means. Please explain.

nvm, sqrtHz already exists as a unit but you should give it its dimension (see the lines around it)

sqrtHz = core.default_unit_database.known_units['sqrtHz']

@DanielSank

Copy link
Copy Markdown
Author

I think a better name would make the class name more informative

Sure. Can you make a suggestion?

@NoureldinYosri

Copy link
Copy Markdown
Collaborator

how about SpectralNoiseDensity?
image

@DanielSank

DanielSank commented Jul 13, 2026

Copy link
Copy Markdown
Author

Power and flux can be used to describe noise, but they are surely not restricted to that case. Adding the word "noise" to these dimensions would be a mistake.

nvm, sqrtHz already exists as a unit

Oh, that's interesting as it is a useful unit for SqrtFlux. But I do not understand your comment

you should give it its dimension (see the lines around it)

Please explain.

@NoureldinYosri

Copy link
Copy Markdown
Collaborator

Please explain.

Change this line

sqrtHz = core.default_unit_database.known_units['sqrtHz']
to

sqrtHz = core.SqrtFlux(core.default_unit_database.known_units['sqrtHz'])

Adding the word "noise" to these dimensions would be a mistake.

if you are sure there is not a better name then we can keep SqrtFlux

@DanielSank

Copy link
Copy Markdown
Author

There is no rush. I will ask others for opinions. Better to get a good name :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants