Skip to content

Commit

Permalink
docs: spelling fixes in the embedded docs (#3252)
Browse files Browse the repository at this point in the history
Co-authored-by: Jos de Jong <[email protected]>
  • Loading branch information
dvd101x and josdejong authored Aug 21, 2024
1 parent 14acdad commit 459ae13
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ Non-breaking changes:

# 2022-05-24, version 10.6.0

- Implementation of fourier transform functions `fft` and `ifft` (#2540).
- Implementation of Fourier transform functions `fft` and `ifft` (#2540).
Thanks @HanchaiN.
- Fix TypeScript types not being listed in the exported fields (#2569).
Thanks @mattvague.
Expand Down
4 changes: 2 additions & 2 deletions src/expression/embeddedDocs/embeddedDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ export const embeddedDocs = {
vacuumImpedance: { description: 'Characteristic impedance of vacuum', examples: ['vacuumImpedance'] },
coulomb: { description: 'Coulomb\'s constant', examples: ['coulomb'] },
elementaryCharge: { description: 'Elementary charge', examples: ['elementaryCharge'] },
bohrMagneton: { description: 'Borh magneton', examples: ['bohrMagneton'] },
bohrMagneton: { description: 'Bohr magneton', examples: ['bohrMagneton'] },
conductanceQuantum: { description: 'Conductance quantum', examples: ['conductanceQuantum'] },
inverseConductanceQuantum: { description: 'Inverse conductance quantum', examples: ['inverseConductanceQuantum'] },
// josephson: {description: 'Josephson constant', examples: ['josephson']},
magneticFluxQuantum: { description: 'Magnetic flux quantum', examples: ['magneticFluxQuantum'] },
nuclearMagneton: { description: 'Nuclear magneton', examples: ['nuclearMagneton'] },
klitzing: { description: 'Von Klitzing constant', examples: ['klitzing'] },

bohrRadius: { description: 'Borh radius', examples: ['bohrRadius'] },
bohrRadius: { description: 'Bohr radius', examples: ['bohrRadius'] },
classicalElectronRadius: { description: 'Classical electron radius', examples: ['classicalElectronRadius'] },
electronMass: { description: 'Electron mass', examples: ['electronMass'] },
fermiCoupling: { description: 'Fermi coupling constant', examples: ['fermiCoupling'] },
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/arithmetic/hypot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const hypotDocs = {
'hypot(a, b, c, ...)',
'hypot([a, b, c, ...])'
],
description: 'Calculate the hypotenusa of a list with values. ',
description: 'Calculate the hypotenuse of a list with values.',
examples: [
'hypot(3, 4)',
'sqrt(3^2 + 4^2)',
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/matrix/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const diffDocs = {
],
description: [
'Create a new matrix or array with the difference of the passed matrix or array.',
'Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference',
'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference',
'If no dimension parameter is passed it is assumed as dimension 0',
'Dimension is zero-based in javascript and one-based in the parser',
'Arrays must be \'rectangular\' meaning arrays like [1, 2]',
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/matrix/fft.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const fftDocs = {
syntax: [
'fft(x)'
],
description: 'Calculate N-dimensional fourier transform',
description: 'Calculate N-dimensional Fourier transform',
examples: [
'fft([[1, 0], [1, 0]])'
],
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/matrix/ifft.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const ifftDocs = {
syntax: [
'ifft(x)'
],
description: 'Calculate N-dimensional inverse fourier transform',
description: 'Calculate N-dimensional inverse Fourier transform',
examples: [
'ifft([[2, 2], [0, 0]])'
],
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/matrix/kron.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const kronDocs = {
syntax: [
'kron(x, y)'
],
description: 'Calculates the kronecker product of 2 matrices or vectors.',
description: 'Calculates the Kronecker product of 2 matrices or vectors.',
examples: [
'kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])',
'kron([1,1], [2,3,4])'
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/special/zeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const zetaDocs = {
syntax: [
'zeta(s)'
],
description: 'Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane',
description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\'s Functional Equation for the entire complex plane',
examples: [
'zeta(0.2)',
'zeta(-0.5)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const quantileSeqDocs = {
'quantileSeq(A, [prob1, prob2, ...][, sorted])',
'quantileSeq(A, N[, sorted])'
],
description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',
description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',
examples: [
'quantileSeq([3, -1, 5, 7], 0.5)',
'quantileSeq([3, -1, 5, 7], [1/3, 2/3])',
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/trigonometry/acoth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const acothDocs = {
syntax: [
'acoth(x)'
],
description: 'Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',
description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',
examples: [
'acoth(2)',
'acoth(0.5)'
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/trigonometry/acsch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const acschDocs = {
syntax: [
'acsch(x)'
],
description: 'Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',
description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',
examples: [
'acsch(0.5)'
],
Expand Down
2 changes: 1 addition & 1 deletion src/expression/embeddedDocs/function/utils/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const cloneDocs = {
syntax: [
'clone(x)'
],
description: 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices',
description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',
examples: [
'clone(3.5)',
'clone(2 - 4i)',
Expand Down
6 changes: 3 additions & 3 deletions src/function/arithmetic/hypot.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const dependencies = [

export const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, addScalar, divideScalar, multiplyScalar, sqrt, smaller, isPositive }) => {
/**
* Calculate the hypotenusa of a list with values. The hypotenusa is defined as:
* Calculate the hypotenuse of a list with values. The hypotenuse is defined as:
*
* hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)
*
* For matrix input, the hypotenusa is calculated for all values in the matrix.
* For matrix input, the hypotenuse is calculated for all values in the matrix.
*
* Syntax:
*
Expand Down Expand Up @@ -52,7 +52,7 @@ export const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed,
})

/**
* Calculate the hypotenusa for an Array with values
* Calculate the hypotenuse for an Array with values
* @param {Array.<number | BigNumber>} args
* @return {number | BigNumber} Returns the result
* @private
Expand Down
4 changes: 2 additions & 2 deletions src/function/matrix/fft.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createFft = /* #__PURE__ */ factory(name, dependencies, ({
log2
}) => {
/**
* Calculate N-dimensional fourier transform
* Calculate N-dimensional Fourier transform
*
* Syntax:
*
Expand All @@ -50,7 +50,7 @@ export const createFft = /* #__PURE__ */ factory(name, dependencies, ({
* ifft
*
* @param {Array | Matrix} arr An array or matrix
* @return {Array | Matrix} N-dimensional fourier transformation of the array
* @return {Array | Matrix} N-dimensional Fourier transformation of the array
*/
return typed(name, {
Array: _ndFft,
Expand Down
4 changes: 2 additions & 2 deletions src/function/matrix/ifft.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const createIfft = /* #__PURE__ */ factory(name, dependencies, ({
conj
}) => {
/**
* Calculate N-dimensional inverse fourier transform
* Calculate N-dimensional inverse Fourier transform
*
* Syntax:
*
Expand All @@ -32,7 +32,7 @@ export const createIfft = /* #__PURE__ */ factory(name, dependencies, ({
* fft
*
* @param {Array | Matrix} arr An array or matrix
* @return {Array | Matrix} N-dimensional fourier transformation of the array
* @return {Array | Matrix} N-dimensional Fourier transformation of the array
*/
return typed(name, {
'Array | Matrix': function (arr) {
Expand Down
8 changes: 4 additions & 4 deletions src/function/matrix/kron.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dependencies = ['typed', 'matrix', 'multiplyScalar']

export const createKron = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, multiplyScalar }) => {
/**
* Calculates the kronecker product of 2 matrices or vectors.
* Calculates the Kronecker product of 2 matrices or vectors.
*
* NOTE: If a one dimensional vector / matrix is given, it will be
* wrapped so its two dimensions.
Expand All @@ -30,7 +30,7 @@ export const createKron = /* #__PURE__ */ factory(name, dependencies, ({ typed,
*
* @param {Array | Matrix} x First vector
* @param {Array | Matrix} y Second vector
* @return {Array | Matrix} Returns the kronecker product of `x` and `y`
* @return {Array | Matrix} Returns the Kronecker product of `x` and `y`
*/
return typed(name, {
'Matrix, Matrix': function (x, y) {
Expand All @@ -49,10 +49,10 @@ export const createKron = /* #__PURE__ */ factory(name, dependencies, ({ typed,
})

/**
* Calculate the kronecker product of two matrices / vectors
* Calculate the Kronecker product of two matrices / vectors
* @param {Array} a First vector
* @param {Array} b Second vector
* @returns {Array} Returns the kronecker product of x and y
* @returns {Array} Returns the Kronecker product of x and y
* @private
*/
function _kron (a, b) {
Expand Down
4 changes: 2 additions & 2 deletions src/function/trigonometry/acoth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const dependencies = ['typed', 'config', 'Complex', 'BigNumber']

export const createAcoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex, BigNumber }) => {
/**
* Calculate the hyperbolic arccotangent of a value,
* Calculate the inverse hyperbolic tangent of a value,
* defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.
*
* To avoid confusion with the matrix hyperbolic arccotangent, this
* To avoid confusion with the matrix inverse hyperbolic tangent, this
* function does not apply to matrices.
*
* Syntax:
Expand Down
4 changes: 2 additions & 2 deletions src/function/trigonometry/acsch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const dependencies = ['typed', 'BigNumber']

export const createAcsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, BigNumber }) => {
/**
* Calculate the hyperbolic arccosecant of a value,
* Calculate the inverse hyperbolic cosecant of a value,
* defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.
*
* To avoid confusion with the matrix hyperbolic arccosecant, this function
* To avoid confusion with the matrix inverse hyperbolic cosecant, this function
* does not apply to matrices.
*
* Syntax:
Expand Down
8 changes: 4 additions & 4 deletions test/unit-tests/function/matrix/fft.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import math from '../../../../src/defaultInstance.js'
const fft = math.fft

describe('fft', function () {
it('should calculate 1-dimensional fourier transformation', function () {
it('should calculate 1-dimensional Fourier transformation', function () {
const in1 = [1, math.complex(2, -1), math.complex(0, -1), math.complex(-1, 2)]
const out1 = [2, math.complex(-2, -2), math.complex(0, -2), math.complex(4, 4)]
approxDeepEqual(fft(in1.valueOf()), out1.valueOf())
approxDeepEqual(fft(math.matrix(in1)), math.matrix(out1))
})

it('should calculate multidimensional fourier transformation', function () {
it('should calculate multidimensional Fourier transformation', function () {
const in1 = [
[1, 0],
[1, 0]
Expand All @@ -39,7 +39,7 @@ describe('fft', function () {
approxDeepEqual(fft(math.matrix(in2)), math.matrix(out2))
})

it('should calculate 1-dimensional non-power-of-2 fourier transformation', function () {
it('should calculate 1-dimensional non-power-of-2 Fourier transformation', function () {
const in1 = [1, 2, 3]
const out1 = [math.complex(6, -0), math.complex(-1.5, 0.8660254), math.complex(-1.5, -0.8660254)]
approxDeepEqual(fft(in1.valueOf()), out1.valueOf())
Expand All @@ -53,7 +53,7 @@ describe('fft', function () {
approxDeepEqual(fft(math.matrix(in2)), math.matrix(out2))
})

it('should calculate multidimensional non-power-of-2 fourier transformation', function () {
it('should calculate multidimensional non-power-of-2 Fourier transformation', function () {
const in1 = [
[1, 2, 3],
[4, 5, 6],
Expand Down
4 changes: 2 additions & 2 deletions test/unit-tests/function/matrix/ifft.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import math from '../../../../src/defaultInstance.js'
const ifft = math.ifft

describe('ifft', function () {
it('should calculate 1-dimensional inverse fourier transformation', function () {
it('should calculate 1-dimensional inverse Fourier transformation', function () {
approxDeepEqual(ifft([2, math.complex(-2, -2), math.complex(0, -2), math.complex(4, 4)]), [1, math.complex(2, -1), math.complex(0, -1), math.complex(-1, 2)])
})

it('should calculate multidimensional inverse fourier transformation', function () {
it('should calculate multidimensional inverse Fourier transformation', function () {
const in1 = [
[1, 0],
[1, 0]
Expand Down
14 changes: 7 additions & 7 deletions test/unit-tests/function/matrix/kron.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// test kronecker product
// test Kronecker product
import assert from 'assert'

import math from '../../../../src/defaultInstance.js'

describe('kron', function () {
it('should calculate the kronecker product of two arrays', function () {
it('should calculate the Kronecker product of two arrays', function () {
assert.deepStrictEqual(math.kron([
[1, -2, 1],
[1, 1, 0]
Expand Down Expand Up @@ -67,36 +67,36 @@ describe('kron', function () {
})

describe('DenseMatrix', function () {
it('should calculate the kronecker product of a 2d matrix (1)', function () {
it('should calculate the Kronecker product of a 2d matrix (1)', function () {
const y = math.matrix([[1, 1], [1, 1]])
const x = math.matrix([[1, 0], [0, 1]])
const product = math.kron(x, y)
assert.deepStrictEqual(product.valueOf(), [[1, 1, 0, 0], [1, 1, 0, 0], [0, 0, 1, 1], [0, 0, 1, 1]])
})

it('should calculate the kronecker product of a 2d matrix (2)', function () {
it('should calculate the Kronecker product of a 2d matrix (2)', function () {
const y = math.matrix([[1, 2], [55, -1]])
const x = math.matrix([[13, 0], [0, -1]])
const product = math.kron(x, y)
assert.deepStrictEqual(product.toArray(), [[13, 26, 0, 0], [715, -13, 0, -0], [0, 0, -1, -2], [0, -0, -55, 1]])
})

it('should throw an error for invalid kronecker product of matrix', function () {
it('should throw an error for invalid Kronecker product of matrix', function () {
const y = math.matrix([[[]]])
const x = math.matrix([[[1, 1], [1, 1]], [[1, 1], [1, 1]]])
assert.throws(function () { math.kron(y, x) })
})
})

describe('SparseMatrix', function () {
it('should calculate the kronecker product of a 2d matrix (1)', function () {
it('should calculate the Kronecker product of a 2d matrix (1)', function () {
const y = math.sparse([[1, 1], [1, 1]])
const x = math.sparse([[1, 0], [0, 1]])
const product = math.kron(x, y)
assert.deepStrictEqual(product.valueOf(), [[1, 1, 0, 0], [1, 1, 0, 0], [0, 0, 1, 1], [0, 0, 1, 1]])
})

it('should calculate the kronecker product of a 2d matrix (2)', function () {
it('should calculate the Kronecker product of a 2d matrix (2)', function () {
const y = math.matrix([[1, 2], [55, -1]], 'sparse')
const x = math.matrix([[13, 0], [0, -1]], 'sparse')
const product = math.kron(x, y)
Expand Down
Loading

0 comments on commit 459ae13

Please sign in to comment.