This repository was archived by the owner on Mar 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Add support for Julia v0.6 [Initial Build] #4
Open
TestSubjector
wants to merge
13
commits into
JuliaAttic:master
Choose a base branch
from
TestSubjector:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e3d6252
Skinned update to v0.6
TestSubjector cd993a3
Fix scale and scale! version problem
TestSubjector c49097a
Update version
TestSubjector 36fab76
Fix scaling conversion
TestSubjector 0a79adb
Fix overlooked case
TestSubjector b7edf8c
Simplified scale alternative
TestSubjector 7b5b38f
Multiplication errors fixed
TestSubjector 3da17cd
Change symbol to Symbol
TestSubjector cae0fbf
Update nomralize, normalize! and Symbol sections
TestSubjector ee23ef6
Fixed several deprecation warnings, by product of the Julia version m…
TestSubjector 3b0058f
Typealias deprecation fix
TestSubjector 150bbe4
Fix more deprecation errors
TestSubjector 24f365c
Minor Fix
TestSubjector File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| julia 0.3 0.4- | ||
| julia 0.6 | ||
| Compat | ||
| Iterators | ||
| Iterators |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,12 +12,12 @@ klabel(i::InnerProduct) = i.k | |
| Base.repr(i::InnerProduct) = brstr(blabel(i))*ktstr(klabel(i))[2:end] | ||
| Base.show(io::IO, i::InnerProduct) = print(io, repr(i)) | ||
|
|
||
| Base.(:(==))(a::InnerProduct, b::InnerProduct) = blabel(a) == blabel(b) && klabel(a) == klabel(b) | ||
| Base.(:(==))(::InnerProduct, ::Number) = false | ||
| Base.(:(==))(::Number, ::InnerProduct) = false | ||
| Base.:(==)(a::InnerProduct, b::InnerProduct) = blabel(a) == blabel(b) && klabel(a) == klabel(b) | ||
| Base.:(==)(::InnerProduct, ::Number) = false | ||
| Base.:(==)(::Number, ::InnerProduct) = false | ||
|
|
||
| Base.hash(i::InnerProduct) = hash(blabel(i), hash(klabel(i))) | ||
| Base.hash(i::InnerProduct, h::Uint64) = hash(hash(i), h) | ||
| Base.hash(i::InnerProduct, h::UInt64) = hash(hash(i), h) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be |
||
|
|
||
| Base.conj(i::InnerProduct) = InnerProduct(klabel(i), blabel(i)) | ||
|
|
||
|
|
@@ -26,7 +26,7 @@ Base.conj(i::InnerProduct) = InnerProduct(klabel(i), blabel(i)) | |
| ############## | ||
|
|
||
| # we can cheat here to avoid tempory StateLabel construction | ||
| # to evaluate KroneckerDelta inner products | ||
| # to evaluate KroneckerDelta inner products | ||
| eval_inner_rule(p::KroneckerDelta, b, k) = inner_rule(p, b, k) | ||
| eval_inner_rule(p::KroneckerDelta, b::StateLabel, k::StateLabel) = inner_rule(p, b, k) | ||
|
|
||
|
|
@@ -48,10 +48,10 @@ inner_mul(v,c,prodtype,b,k) = v * c * eval_inner_rule(prodtype, b, k) | |
| # InnerExpr # | ||
| ############## | ||
| # A InnerExpr is a type that wraps arthimetic expressions | ||
| # performed with InnerExprs. The allows storage and | ||
| # delayed evaluation of expressions. For example, this | ||
| # performed with InnerExprs. The allows storage and | ||
| # delayed evaluation of expressions. For example, this | ||
| # expression: | ||
| # | ||
| # | ||
| # (< a | b >^2 + < c | d >^2 - 3.13+im) / 2 | ||
| # | ||
| # is representable as a InnerExpr. | ||
|
|
@@ -66,7 +66,7 @@ InnerExpr{N<:Number}(n::N) = convert(InnerExpr, n) | |
| Base.convert(::Type{InnerExpr}, iex::InnerExpr) = iex | ||
| Base.convert{N<:Number}(::Type{InnerExpr}, n::N) = InnerExpr(Expr(:call, +, n)) | ||
|
|
||
| Base.(:(==))(a::InnerExpr, b::InnerExpr) = a.ex == b.ex | ||
| Base.:(==)(a::InnerExpr, b::InnerExpr) = a.ex == b.ex | ||
| same_num(a::Number, b::Number) = a == b | ||
| same_num(a::InnerExpr, b::InnerExpr) = a == b | ||
| same_num(iex::InnerExpr, i::InnerProduct) = iex == InnerExpr(i) | ||
|
|
@@ -75,15 +75,15 @@ same_num(iex::InnerExpr, n::Number) = iex == InnerExpr(n) | |
| same_num(n::Number, iex::InnerExpr) = iex == n | ||
|
|
||
| Base.hash(iex::InnerExpr) = hash(iex.ex) | ||
| Base.hash(iex::InnerExpr, h::Uint64) = hash(hash(iex), h) | ||
| Base.hash(iex::InnerExpr, h::UInt64) = hash(hash(iex), h) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here - |
||
|
|
||
| Base.one(::InnerExpr) = InnerExpr(1) | ||
| Base.zero(::InnerExpr) = InnerExpr(0) | ||
|
|
||
| Base.promote_rule{N<:Number}(::Type{InnerExpr}, ::Type{N}) = InnerExpr | ||
|
|
||
| Base.length(iex::InnerExpr) = length(iex.ex.args) | ||
| Base.getindex(iex::InnerExpr, i) = iex.ex.args[i] | ||
| Base.getindex(iex::InnerExpr, i::Integer) = iex.ex.args[i] | ||
|
|
||
| ############## | ||
| # inner_eval # | ||
|
|
@@ -123,20 +123,20 @@ function iexpr_exp(a, b) | |
| end | ||
| end | ||
|
|
||
| Base.(:^)(a::InnerExpr, b::Integer) = iexpr_exp(a, b) | ||
| Base.(:^)(a::InnerExpr, b::Rational) = iexpr_exp(a, b) | ||
| Base.(:^)(a::InnerExpr, b::InnerExpr) = iexpr_exp(a, b) | ||
| Base.(:^)(a::InnerExpr, b::Number) = iexpr_exp(a, b) | ||
| Base.(:^)(a::MathConst{:e}, b::InnerExpr) = iexpr_exp(a, b) | ||
| Base.(:^)(a::Number, b::InnerExpr) = iexpr_exp(a, b) | ||
| Base.:^(a::InnerExpr, b::Integer) = iexpr_exp(a, b) | ||
| Base.:^(a::InnerExpr, b::Rational) = iexpr_exp(a, b) | ||
| Base.:^(a::InnerExpr, b::InnerExpr) = iexpr_exp(a, b) | ||
| Base.:^(a::InnerExpr, b::Number) = iexpr_exp(a, b) | ||
| #Base.:^(a::MathConst{:e}, b::InnerExpr) = iexpr_exp(a, b) | ||
| Base.:^(a::Number, b::InnerExpr) = iexpr_exp(a, b) | ||
|
|
||
| Base.exp(iex::InnerExpr) = InnerExpr(:(exp($(iex)))) | ||
| Base.exp2(iex::InnerExpr) = InnerExpr(:(exp2($(iex)))) | ||
|
|
||
| Base.sqrt(iex::InnerExpr) = InnerExpr(:(sqrt($(iex)))) | ||
|
|
||
| Base.log(iex::InnerExpr) = length(iex)==2 && iex[1]==:exp ? iex[2] : InnerExpr(:(log($(iex)))) | ||
| Base.log(a::MathConst{:e}, b::InnerExpr) = InnerExpr(:(log($(a),$(b)))) | ||
| #Base.log(a::MathConst{:e}, b::InnerExpr) = InnerExpr(:(log($(a),$(b)))) | ||
| Base.log(a::InnerExpr, b::InnerExpr) = InnerExpr(:(log($(a),$(b)))) | ||
| Base.log(a::InnerExpr, b::Number) = InnerExpr(:(log($(a),$(b)))) | ||
| Base.log(a::Number, b::InnerExpr) = InnerExpr(:(log($(a),$(b)))) | ||
|
|
@@ -157,11 +157,11 @@ function iexpr_mul(a,b) | |
| end | ||
| end | ||
|
|
||
| Base.(:*)(a::InnerExpr, b::InnerExpr) =iexpr_mul(a,b) | ||
| Base.(:*)(a::Bool, b::InnerExpr) = iexpr_mul(a,b) | ||
| Base.(:*)(a::InnerExpr, b::Bool) = iexpr_mul(a,b) | ||
| Base.(:*)(a::InnerExpr, b::Number) = iexpr_mul(a,b) | ||
| Base.(:*)(a::Number, b::InnerExpr) = iexpr_mul(a,b) | ||
| Base.:*(a::InnerExpr, b::InnerExpr) =iexpr_mul(a,b) | ||
| Base.:*(a::Bool, b::InnerExpr) = iexpr_mul(a,b) | ||
| Base.:*(a::InnerExpr, b::Bool) = iexpr_mul(a,b) | ||
| Base.:*(a::InnerExpr, b::Number) = iexpr_mul(a,b) | ||
| Base.:*(a::Number, b::InnerExpr) = iexpr_mul(a,b) | ||
|
|
||
| ############ | ||
| # Division # | ||
|
|
@@ -180,16 +180,16 @@ function iexpr_div(a, b) | |
| end | ||
| end | ||
|
|
||
| Base.(:/)(a::InnerExpr, b::InnerExpr) = iexpr_div(a, b) | ||
| Base.(:/)(a::InnerExpr, b::Complex) = iexpr_div(a, b) | ||
| Base.(:/)(a::InnerExpr, b::Number) = iexpr_div(a, b) | ||
| Base.(:/)(a::Number, b::InnerExpr) = iexpr_div(a, b) | ||
| Base.:/(a::InnerExpr, b::InnerExpr) = iexpr_div(a, b) | ||
| Base.:/(a::InnerExpr, b::Complex) = iexpr_div(a, b) | ||
| Base.:/(a::InnerExpr, b::Number) = iexpr_div(a, b) | ||
| Base.:/(a::Number, b::InnerExpr) = iexpr_div(a, b) | ||
|
|
||
| ############ | ||
| # Addition # | ||
| ############ | ||
| function iexpr_add(a, b) | ||
| if same_num(a, 0) | ||
| if same_num(a, 0) | ||
| return InnerExpr(b) | ||
| elseif same_num(b, 0) | ||
| return InnerExpr(a) | ||
|
|
@@ -198,14 +198,14 @@ function iexpr_add(a, b) | |
| end | ||
| end | ||
|
|
||
| Base.(:+)(a::InnerExpr, b::InnerExpr) = iexpr_add(a, b) | ||
| Base.(:+)(a::InnerExpr, b::Number) = iexpr_add(a, b) | ||
| Base.(:+)(a::Number, b::InnerExpr) = iexpr_add(a, b) | ||
| Base.:+(a::InnerExpr, b::InnerExpr) = iexpr_add(a, b) | ||
| Base.:+(a::InnerExpr, b::Number) = iexpr_add(a, b) | ||
| Base.:+(a::Number, b::InnerExpr) = iexpr_add(a, b) | ||
|
|
||
| ############### | ||
| # Subtraction # | ||
| ############### | ||
| Base.(:-)(iex::InnerExpr) = length(iex)==2 && iex[1]==:- ? InnerExpr(iex[2]) : InnerExpr(:(-$(iex))) | ||
| Base.:-(iex::InnerExpr) = length(iex)==2 && iex[1]==:- ? InnerExpr(iex[2]) : InnerExpr(:(-$(iex))) | ||
|
|
||
| function iexpr_subtract(a, b) | ||
| if same_num(a, b) | ||
|
|
@@ -219,9 +219,9 @@ function iexpr_subtract(a, b) | |
| end | ||
| end | ||
|
|
||
| Base.(:-)(a::InnerExpr, b::InnerExpr) = iexpr_subtract(a, b) | ||
| Base.(:-)(a::InnerExpr, b::Number) = iexpr_subtract(a, b) | ||
| Base.(:-)(a::Number, b::InnerExpr) = iexpr_subtract(a, b) | ||
| Base.:-(a::InnerExpr, b::InnerExpr) = iexpr_subtract(a, b) | ||
| Base.:-(a::InnerExpr, b::Number) = iexpr_subtract(a, b) | ||
| Base.:-(a::Number, b::InnerExpr) = iexpr_subtract(a, b) | ||
|
|
||
| ################## | ||
| # Absolute Value # | ||
|
|
@@ -239,7 +239,7 @@ Base.ctranspose(iex::InnerExpr) = conj(iex) | |
| # Elementwise Operations # | ||
| ########################## | ||
| for op=(:*,:-,:+,:/,:^) | ||
| elop = symbol(string(:.) * string(op)) | ||
| elop = Symbol(string(:.) * string(op)) | ||
| @eval begin | ||
| ($elop)(a::InnerExpr, b::InnerExpr) = ($op)(a,b) | ||
| ($elop)(a::InnerExpr, b::Number) = ($op)(a,b) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,9 @@ | |
| ############## | ||
| immutable StateLabel{N} | ||
| label::NTuple{N} | ||
| hash::Uint64 | ||
| StateLabel(label::NTuple{N}) = new(label, hash(label)) | ||
| StateLabel(label::NTuple{N}, h::Uint64) = new(label, h) | ||
| hash::UInt64 | ||
| StateLabel{N}(label::NTuple{N}) where N = new(label, hash(label)) | ||
| StateLabel{N}(label::NTuple{N}, h::UInt64) where N = new(label, h) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some more |
||
| end | ||
|
|
||
| StateLabel(s::StateLabel) = s | ||
|
|
@@ -18,9 +18,9 @@ Base.getindex(s::StateLabel, arr::AbstractArray) = s.label[arr] | |
|
|
||
| Base.copy{N}(s::StateLabel{N}) = StateLabel{N}(s.label, s.hash) | ||
| Base.hash(s::StateLabel) = s.hash | ||
| Base.hash(s::StateLabel, h::Uint64) = hash(hash(s), h) | ||
| Base.hash(s::StateLabel, h::UInt64) = hash(hash(s), h) | ||
|
|
||
| Base.(:(==)){N}(a::StateLabel{N},b::StateLabel{N}) = hash(a) == hash(b) | ||
| Base.:(==){N}(a::StateLabel{N},b::StateLabel{N}) = hash(a) == hash(b) | ||
|
|
||
| Base.start(s::StateLabel) = start(s.label) | ||
| Base.next(s::StateLabel, i) = next(s.label, i) | ||
|
|
@@ -32,7 +32,7 @@ Base.endof(s::StateLabel) = endof(s.label) | |
|
|
||
| Base.length{N}(::StateLabel{N}) = N | ||
|
|
||
| Base.map(f::Union(Function,DataType), s::StateLabel) = StateLabel(map(f, s.label)) | ||
| #Base.map(f::Union(Function,DataType), s::StateLabel) = StateLabel(map(f, s.label)) | ||
|
|
||
| tensor(a::StateLabel, b::StateLabel) = StateLabel(tuple(a.label..., b.label...)) | ||
|
|
||
|
|
@@ -46,9 +46,9 @@ Base.show(io::IO, s::StateLabel) = print(io, repr(s)) | |
| immutable OpLabel{N} | ||
| k::StateLabel{N} | ||
| b::StateLabel{N} | ||
| hash::Uint64 | ||
| OpLabel(k::StateLabel{N}, b::StateLabel{N}) = new(k, b, hash(k, hash(b))) | ||
| OpLabel(k::StateLabel{N}, b::StateLabel{N}, h::Uint64) = new(k, b, h) | ||
| hash::UInt64 | ||
| OpLabel{N}(k::StateLabel{N}, b::StateLabel{N}) where N = new(k, b, hash(k, hash(b))) | ||
| OpLabel{N}(k::StateLabel{N}, b::StateLabel{N}, h::UInt64) where N = new(k, b, h) | ||
| end | ||
|
|
||
| OpLabel(op::OpLabel) = op | ||
|
|
@@ -61,9 +61,9 @@ blabel(o::OpLabel) = o.b | |
|
|
||
| Base.copy{N}(o::OpLabel{N}) = OpLabel{N}(o.k, o.b, o.hash) | ||
| Base.hash(o::OpLabel) = o.hash | ||
| Base.hash(o::OpLabel, h::Uint64) = hash(hash(o), h) | ||
| Base.hash(o::OpLabel, h::UInt64) = hash(hash(o), h) | ||
|
|
||
| Base.(:(==)){N}(a::OpLabel{N}, b::OpLabel{N}) = hash(a) == hash(b) | ||
| Base.:(==){N}(a::OpLabel{N}, b::OpLabel{N}) = hash(a) == hash(b) | ||
|
|
||
| Base.length{N}(::OpLabel{N}) = N | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole warning should probably go away, any version handling should just go into the REQUIRE anyway