Commit graph

32 commits

Author SHA1 Message Date
Jutho Haegeman
a04c500646 try using atomic{int} for growinglist length 2021-06-15 01:18:49 +02:00
Jutho Haegeman
04098cb2c2 various updates for efficiency; restore recursive sumlist 2021-06-14 17:00:19 +02:00
Jutho Haegeman
b1303b9b79 major update, thread safety, improved efficiency 2021-06-11 15:50:25 +02:00
Jutho Haegeman
f06635b64b get rid of __init__ function, no longer necessary 2021-06-04 11:18:03 +02:00
w-vdh
7394e8c3cf
Update function documentation (#10)
to reflect the use of RationalRoot as default return type.
2020-02-01 21:22:34 +01:00
Jutho Haegeman
8ee830e173 use RationalRoots representation 2019-08-07 10:09:22 +02:00
Jutho Haegeman
80cc592dd3 fix fast path in conversion 2019-07-29 17:49:20 +02:00
Jutho Haegeman
52d2255d64 clean up prime 2019-07-29 17:09:38 +02:00
Jutho
a5ee2d5fc6
Switch to using HalfIntegers (#6)
* swich to using HalfIntegers, add project.toml, bump version, update CI

* add Random and add seed to avoid unlikely test failure
2019-07-09 00:53:40 +02:00
Morten Piibeleht
6ddbd340b0 Make convert(Real, ::HalfInteger) yield HalfInteger (#5)
As HalfInteger <: Real, there should be no reason to convert anything in
this situation. It happens because the convert method resorts to Float64
as an intermediate value.

To still get conversion to floats, we can just dispatch on AbstractFloat
instead. However, it should be better to convert the numerator to T
first and then divide, so that we would not use a potentially lower
precision intermediate value.

This solves the problem where calling sum on an vector of HalfIntegers
yields a floating point value, even though there is no reason to convert
in the summation:

julia> sum([HalfInteger(1//2), HalfInteger(3//2)])
2.0

This is because there is an implicit convert(::Real) in the Base.add_sum
function. With this patch the sum call correctly yields a HalfInteger.

It also updates the tests related to HalfInteger convert methods:

 - Make sure that the convert tests also check types
 - Add a few tests for converting out of HalfInteger
2019-02-21 00:16:26 +01:00
Jutho Haegeman
65e3f34649 export HalfInteger 2019-01-10 23:05:52 +01:00
Morten Piibeleht
8ebb2c791b Partially revamp the HalfInteger type (#4)
* Call the HalfInteger field twofold

Makes it more immediately obvious what the meaning of the value stored
in the field is.

* Introduce new constructors for HalfInteger

The primary inner constructor mirrors the two-argument constructor of
the Rational type, where the user provides the numerator and denominator
values.

There is also a single argument outer constructor that makes HalfInteger
behave like a normal numeric type such that HalfInteger(n) == n.

* Move HalfInteger tests to a separate file

The using statements in halfinteger.jl are there so that it would be
possible to run the file separately from the other tests.

* Test the single-argument HalfInteger constructor

* Organize halfinteger.jl a bit

Prioritise the convert methods.

* Add multiplication with integer to HalfInteger

* Implement parsing and printing for HalfInteger

* parse(::HalfInteger, x) method
* Overload show to pretty-print HalfInteger

* Overload Base.numerator/denominator

And add tests for the other supplementary functions and methods as
well.

* Add HalfIntegerRange type

Can be constructed using the range operator :. Currently only supports
unit steps in the positive direction.

* Address feedback

* Rename .twofold -> .numerator
* Consistent variable names
* Remove unnecessary methods for HalfIntegerRange

* Allow constructing HalfIntegerRange with non-integer difference

* Add docs and ceil(::HalfInteger)
2019-01-10 21:50:46 +01:00
Jutho
39bbd0ced8 update HalfInteger 2018-10-05 17:20:22 +02:00
Jutho Haegeman
dd208b42a6 first attempt to (exclusive) v0.7 compatibility 2018-06-21 23:29:33 +02:00
Jutho Haegeman
0b8be07d6a remove erroneous empty line 2018-06-17 02:08:51 +02:00
Jutho Haegeman
cdb460332c speed improvement plus v0.7 compatibility 2018-01-31 17:10:37 +08:00
Jutho Haegeman
21688c9a2b improve speed of conversion from halfinteger to integer 2018-01-30 16:47:07 +08:00
Jutho Haegeman
ba3303cb68 Move halfinteger into WignerSymbols 2018-01-30 16:11:33 +08:00
Jutho
61eaa24215 deprecation fix 2018-01-24 16:45:33 +01:00
Jutho Haegeman
b734fe001f Update for latest version of v0.7 2017-12-08 00:52:21 +01:00
Jutho Haegeman
9350aae469 Fix argument order in clebschgordan docs. 2017-11-10 11:20:03 +01:00
Jutho Haegeman
dd75309fe6 Enable precompilation 2017-10-27 16:28:53 +02:00
Jutho Haegeman
258246f854 add MPZ for 0.6 compatibility; update REQUIRE, add testsets 2017-10-14 01:33:52 +02:00
Jutho Haegeman
cb09b427c9 bugfix in Racah W sign when different irreps don't match 2017-10-09 15:28:29 +02:00
Jutho Haegeman
e56bea0cf9 fix bug in delta 2017-10-06 23:27:58 +02:00
Jutho
f647d8948b fix depwarn for .+ in range 2017-09-26 10:39:58 +02:00
Jutho
1a974193eb add help and more tests 2017-08-11 12:55:57 +02:00
Jutho
56b02ebcf2 3j and 6j working and tested 2017-08-09 17:12:37 +02:00
Jutho Haegeman
b9eb46d5cd updates 2017-08-09 12:13:46 +02:00
Jutho
46d5624e0f first code 2 2017-08-08 16:57:31 +02:00
Jutho
c0f00d5d61 first code 2017-08-08 16:57:20 +02:00
Jutho
a5395dca5b WignerSymbols.jl generated files.
license:  MIT
    authors:  Jutho
    years:    2017
    user:     jutho

Julia Version 0.7.0-DEV.1283 [4fea203375]
2017-08-08 11:23:18 +02:00