Finding combinations of variables that can take value of -1/0/1 that produce sum of 0 with added constraint I have 64 variables that can either take a value of -1, 0, or 1 and I am interested in finding all possible combinations of variables such that I have n variables in each the positive and negative state.

Does anyone know what the best way would be to calculate the full set of combination values that fits this constraint? 

Right now I just implemented a simple counting algorithm, but that will take forever since I have to test if there are n positive and negative variables at 3^64 levels, and that is before I even start to evaluate the weighting term I am actually interested in.
There will be ${64 \choose n} \cdot {64-n \choose n}$ such combinations, since there are ${64 \choose n}$ ways to choose a subset of $n$ of the 64 variables to be -1, and then ${64-n \choose n}$ ways to choose a subset of $n$ of the $64-n$ remaining variables to be 1.  Equivalently, this is ${64! \over n!^2 (64-2n)!}$.

You probably won't want to explicitly generate all of those combinations, as it would take exponentially long to do so (as there are exponentially many such combinations).

But if you really wanted to explicitly enumerate all combinations, this formula also highlights the way to do that.  First, enumerate all possible ways to choose $n$ of the 64 variables; there are standard algorithms for how to do that (e.g., https://stackoverflow.com/q/127704/781723, https://en.wikipedia.org/wiki/Combination#Enumerating_k-combinations).  Then, for each such, enumerate all possible ways to choose $n$ of the remaining $64-n$ variables (again, using the same algorithm).  That will give you all ways to choose a combination of the sort you desire.

Still, any time you are enumerating exponentially many possibilities and then doing something to each, you should check whether maybe there's a better way to achieve your ultimate goal without enumerating all of them.  If you want to find the combination that minimizes some cost function, there might be a better way to do that, depending on the cost function.